From patchwork Fri Nov 6 23:07:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 58280 X-Patchwork-Delegate: kyle@mcmartin.ca Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA6N7p5w027752 for ; Fri, 6 Nov 2009 23:07:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753708AbZKFXHp (ORCPT ); Fri, 6 Nov 2009 18:07:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758762AbZKFXHp (ORCPT ); Fri, 6 Nov 2009 18:07:45 -0500 Received: from mail.gmx.net ([213.165.64.20]:58594 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753708AbZKFXHo (ORCPT ); Fri, 6 Nov 2009 18:07:44 -0500 Received: (qmail invoked by alias); 06 Nov 2009 23:07:49 -0000 Received: from p4FDB2AE4.dip0.t-ipconnect.de (EHLO p100.box) [79.219.42.228] by mail.gmx.net (mp051) with SMTP; 07 Nov 2009 00:07:49 +0100 X-Authenticated: #1045983 X-Provags-ID: V01U2FsdGVkX181Co4QqKA18uquj/DxRJrQA/YbPM1dNy0Zn430DR irdRb6aMUUh7A8 Date: Sat, 7 Nov 2009 00:07:42 +0100 From: Helge Deller To: John David Anglin , linux-parisc@vger.kernel.org, Kyle McMartin Subject: Re: Out of order unwind entry warning Message-ID: <20091106230742.GA16061@p100.box> References: <4AF0A8FB.2000504@gmx.de> <20091104005737.0E4674FB2@hiauly1.hia.nrc.ca> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091104005737.0E4674FB2@hiauly1.hia.nrc.ca> User-Agent: Mutt/1.5.19 (2009-01-05) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.43 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index 69dad5a..9dbefa8 100644 --- a/arch/parisc/kernel/unwind.c +++ b/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 *