提交 8f78df87 编写于 作者: H Helge Deller 提交者: Kyle McMartin

parisc: use sort() instead of home-made implementation (v2)

Signed-off-by: NHelge Deller <deller@gmx.de>
Signed-off-by: NRandolph Chung <tausq@parisc-linux.org>
Signed-off-by: NKyle McMartin <kyle@mcmartin.ca>
上级 11e17809
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/kallsyms.h> #include <linux/kallsyms.h>
#include <linux/sort.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/assembly.h> #include <asm/assembly.h>
...@@ -115,24 +116,18 @@ unwind_table_init(struct unwind_table *table, const char *name, ...@@ -115,24 +116,18 @@ unwind_table_init(struct unwind_table *table, const char *name,
} }
} }
static int cmp_unwind_table_entry(const void *a, const void *b)
{
return ((const struct unwind_table_entry *)a)->region_start
- ((const struct unwind_table_entry *)b)->region_start;
}
static void static void
unwind_table_sort(struct unwind_table_entry *start, unwind_table_sort(struct unwind_table_entry *start,
struct unwind_table_entry *finish) struct unwind_table_entry *finish)
{ {
struct unwind_table_entry el, *p, *q; sort(start, finish - start, sizeof(struct unwind_table_entry),
cmp_unwind_table_entry, NULL);
for (p = start + 1; p < finish; ++p) {
if (p[0].region_start < p[-1].region_start) {
el = *p;
q = p;
do {
q[0] = q[-1];
--q;
} while (q > start &&
el.region_start < q[-1].region_start);
*q = el;
}
}
} }
struct unwind_table * struct unwind_table *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册