aboutsummaryrefslogtreecommitdiff
path: root/arch/parisc/kernel/unwind.c
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2009-11-06 23:07:42 +0000
committerKyle McMartin <kyle@mcmartin.ca>2009-12-16 03:48:55 +0000
commit8f78df872d463ac43315916663b3e688ebb2422f (patch)
tree658bb527a0be78e68b29288d5595847896aac47b /arch/parisc/kernel/unwind.c
parent11e178091f6a9c5ca479f8a276b9dd0dfacf8fc4 (diff)
downloadleg-kernel-8f78df872d463ac43315916663b3e688ebb2422f.tar.gz
parisc: use sort() instead of home-made implementation (v2)
Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Randolph Chung <tausq@parisc-linux.org> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Diffstat (limited to 'arch/parisc/kernel/unwind.c')
-rw-r--r--arch/parisc/kernel/unwind.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c
index f03f6fb0ec83..d58eac1a8288 100644
--- a/arch/parisc/kernel/unwind.c
+++ b/arch/parisc/kernel/unwind.c
@@ -13,6 +13,7 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/kallsyms.h>
+#include <linux/sort.h>
#include <asm/uaccess.h>
#include <asm/assembly.h>
@@ -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
unwind_table_sort(struct unwind_table_entry *start,
struct unwind_table_entry *finish)
{
- struct unwind_table_entry el, *p, *q;
-
- 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;
- }
- }
+ sort(start, finish - start, sizeof(struct unwind_table_entry),
+ cmp_unwind_table_entry, NULL);
}
struct unwind_table *