[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50EDE403.4070208@redhat.com>
Date: Wed, 09 Jan 2013 16:41:23 -0500
From: Rik van Riel <riel@...hat.com>
To: Michel Lespinasse <walken@...gle.com>
CC: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
"James E.J. Bottomley" <jejb@...isc-linux.org>,
Matt Turner <mattst88@...il.com>,
David Howells <dhowells@...hat.com>,
Tony Luck <tony.luck@...el.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
linuxppc-dev@...ts.ozlabs.org, linux-parisc@...r.kernel.org,
linux-alpha@...r.kernel.org, linux-ia64@...r.kernel.org
Subject: Re: [PATCH 7/8] mm: use vm_unmapped_area() on powerpc architecture
On 01/09/2013 06:23 AM, Michel Lespinasse wrote:
> On Wed, Jan 09, 2013 at 02:32:56PM +1100, Benjamin Herrenschmidt wrote:
>> Ok. I think at least you can move that construct:
>>
>> + if (addr < SLICE_LOW_TOP) {
>> + slice = GET_LOW_SLICE_INDEX(addr);
>> + addr = (slice + 1) << SLICE_LOW_SHIFT;
>> + if (!(available.low_slices & (1u << slice)))
>> + continue;
>> + } else {
>> + slice = GET_HIGH_SLICE_INDEX(addr);
>> + addr = (slice + 1) << SLICE_HIGH_SHIFT;
>> + if (!(available.high_slices & (1u << slice)))
>> + continue;
>> + }
>>
>> Into some kind of helper. It will probably compile to the same thing but
>> at least it's more readable and it will avoid a fuckup in the future if
>> somebody changes the algorithm and forgets to update one of the
>> copies :-)
>
> All right, does the following look more palatable then ?
> (didn't re-test it, though)
Looks equivalent. I have also not tested :)
> Signed-off-by: Michel Lespinasse <walken@...gle.com>
Acked-by: Rik van Riel <riel@...hat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists