[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100323104241.GA1189@elte.hu>
Date: Tue, 23 Mar 2010 11:42:41 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Yinghai Lu <yinghai@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>,
David Miller <davem@...emloft.net>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [RFC PATCH -v3 1/2] lmb: seperate region array from lmb_region
struct
* Yinghai Lu <yinghai@...nel.org> wrote:
> void __init lmb_init(void)
> {
> + lmb.memory.region = lmb_memory_region;
> + lmb.memory.region_array_size = ARRAY_SIZE(lmb_memory_region);
> + lmb.reserved.region = lmb_reserved_region;
> + lmb.reserved.region_array_size = ARRAY_SIZE(lmb_reserved_region);
> +
That's rather unreadable and has random whitespace noise.
Should be something like:
lmb.memory.region = lmb_memory_region;
lmb.memory.region_array_size = ARRAY_SIZE(lmb_memory_region);
lmb.reserved.region = lmb_reserved_region;
lmb.reserved.region_array_size = ARRAY_SIZE(lmb_reserved_region);
also, i'd suggest to shorten region_array_size to region_size (we know it's an
array), so it would become:
lmb.memory.region = lmb_memory_region;
lmb.memory.region_size = ARRAY_SIZE(lmb_memory_region);
lmb.reserved.region = lmb_reserved_region;
lmb.reserved.region_size = ARRAY_SIZE(lmb_reserved_region);
> - if (rgn->cnt >= MAX_LMB_REGIONS)
> + if (rgn->cnt >= (rgn->region_array_size - 1))
> return -1;
'x >= y-1' is equivalent to 'x > y', so that should be:
if (rgn->cnt > rgn->region_size)
Ingo
--
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