diff options
author | Helge Deller <deller@gmx.de> | 2009-11-06 18:07:42 -0500 |
---|---|---|
committer | Kyle McMartin <kyle@mcmartin.ca> | 2009-12-15 22:48:55 -0500 |
commit | 8f78df872d463ac43315916663b3e688ebb2422f (patch) | |
tree | 658bb527a0be78e68b29288d5595847896aac47b /arch/parisc | |
parent | 11e178091f6a9c5ca479f8a276b9dd0dfacf8fc4 (diff) |
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')
-rw-r--r-- | arch/parisc/kernel/unwind.c | 23 |
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 @@ | |||
13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/kallsyms.h> | 15 | #include <linux/kallsyms.h> |
16 | #include <linux/sort.h> | ||
16 | 17 | ||
17 | #include <asm/uaccess.h> | 18 | #include <asm/uaccess.h> |
18 | #include <asm/assembly.h> | 19 | #include <asm/assembly.h> |
@@ -115,24 +116,18 @@ unwind_table_init(struct unwind_table *table, const char *name, | |||
115 | } | 116 | } |
116 | } | 117 | } |
117 | 118 | ||
119 | static int cmp_unwind_table_entry(const void *a, const void *b) | ||
120 | { | ||
121 | return ((const struct unwind_table_entry *)a)->region_start | ||
122 | - ((const struct unwind_table_entry *)b)->region_start; | ||
123 | } | ||
124 | |||
118 | static void | 125 | static void |
119 | unwind_table_sort(struct unwind_table_entry *start, | 126 | unwind_table_sort(struct unwind_table_entry *start, |
120 | struct unwind_table_entry *finish) | 127 | struct unwind_table_entry *finish) |
121 | { | 128 | { |
122 | struct unwind_table_entry el, *p, *q; | 129 | sort(start, finish - start, sizeof(struct unwind_table_entry), |
123 | 130 | cmp_unwind_table_entry, NULL); | |
124 | for (p = start + 1; p < finish; ++p) { | ||
125 | if (p[0].region_start < p[-1].region_start) { | ||
126 | el = *p; | ||
127 | q = p; | ||
128 | do { | ||
129 | q[0] = q[-1]; | ||
130 | --q; | ||
131 | } while (q > start && | ||
132 | el.region_start < q[-1].region_start); | ||
133 | *q = el; | ||
134 | } | ||
135 | } | ||
136 | } | 131 | } |
137 | 132 | ||
138 | struct unwind_table * | 133 | struct unwind_table * |