From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: Exception while handling MEM Hole on OMAP3 / ARM Cortex A8 Date: Thu, 17 Sep 2009 22:08:59 +0100 Message-ID: <20090917210859.GB10599@shareable.org> References: <0680EC522D0CC943BC586913CF3768C003790C65ED@dbde02.ent.ti.com> <20090815181711.GG29616@n2100.arm.linux.org.uk> <20090817173343.GA17323@debian> <20090817174718.GU10764@n2100.arm.linux.org.uk> <20090817180145.GA17378@debian> <20090817180455.GW10764@n2100.arm.linux.org.uk> <20090818030148.GA2283@debian> <20090907142210.GB23361@n2100.arm.linux.org.uk> <20090915113256.GB1328@ucw.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail2.shareable.org ([80.68.89.115]:53835 "EHLO mail2.shareable.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752910AbZIQVJJ (ORCPT ); Thu, 17 Sep 2009 17:09:09 -0400 Content-Disposition: inline In-Reply-To: <20090915113256.GB1328@ucw.cz> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Pavel Machek Cc: Russell King - ARM Linux , Rabin Vincent , "Aguirre Rodriguez, Sergio Alberto" , "Syed Mohammed, Khasim" , "linux-arm-kernel@lists.arm.linux.org.uk" , "linux-omap@vger.kernel.org" Pavel Machek wrote: > On Mon 2009-09-07 15:22:10, Russell King - ARM Linux wrote: > > On Tue, Aug 18, 2009 at 08:31:49AM +0530, Rabin Vincent wrote: > > > Here's a fixed version: > > > > And here's my revised version with these fixes in. I changed the > > while loop to a do..while loop instead (since we will always have > > at least one memory bank, it's pointless doing that test for the > > first iteration.) > > > > Acks and tested-bys would be useful please. > > > > > +static int __init meminfo_cmp(const void *_a, const void *_b) > > +{ > > + const struct membank *a = _a, *b = _b; > > + long cmp = bank_pfn_start(a) - bank_pfn_start(b); > > + return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; > > +} > > I believe you can just return cmp here. If this were generic code, the long value might overflow int. But this is ARM code, limited to 32 bits, so it could. It'd be asking for trouble if someone copied the code elsewhere, though. -- Jamie