From d76a5fd736b64509a24b483a19fd73a0e71b0b1d Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Fri, 6 Nov 2009 23:07:42 +0000 Subject: [PATCH] --- yaml --- r: 176901 b: refs/heads/master c: 8f78df872d463ac43315916663b3e688ebb2422f h: refs/heads/master i: 176899: 6b0495faec0001199df44d8492c465b28f4a6489 v: v3 --- [refs] | 2 +- trunk/arch/parisc/kernel/unwind.c | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index 6ab75f78b5d7..128f3a892d00 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 11e178091f6a9c5ca479f8a276b9dd0dfacf8fc4 +refs/heads/master: 8f78df872d463ac43315916663b3e688ebb2422f diff --git a/trunk/arch/parisc/kernel/unwind.c b/trunk/arch/parisc/kernel/unwind.c index f03f6fb0ec83..d58eac1a8288 100644 --- a/trunk/arch/parisc/kernel/unwind.c +++ b/trunk/arch/parisc/kernel/unwind.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -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 *