public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Paul Mundt <lethal@linux-sh.org>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Miller <davem@davemloft.net>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [RFC PATCH -v3 1/2] lmb: seperate region array from lmb_region struct
Date: Tue, 23 Mar 2010 10:17:49 -0700	[thread overview]
Message-ID: <4BA8F7BD.20401@kernel.org> (raw)
In-Reply-To: <20100323131839.GA31552@linux-sh.org>

On 03/23/2010 06:18 AM, Paul Mundt wrote:
> On Tue, Mar 23, 2010 at 11:42:41AM +0100, Ingo Molnar wrote:
>>
>> * Yinghai Lu <yinghai@kernel.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);
>>
> I don't mean to be pedantic, but the LMB code already has a lot of
> region.size references so region_size looks a bit awkward. All of the
> accessors in linux/lmb.h use region_nr as the array index, so perhaps
> nr_regions would be less ambiguous.

@@ -26,7 +26,8 @@ struct lmb_property {
 struct lmb_region {
 	unsigned long cnt;
 	u64 size;
-	struct lmb_property region[MAX_LMB_REGIONS+1];
+	struct lmb_property *region;
+	unsigned long region_array_size;
 };

cnt is number of slots used.
size is memory size

can we use rgn_sz for region array size?

YH

  parent reply	other threads:[~2010-03-23 17:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-23  8:39 [PATCH 00/04] use lmb with x86 Yinghai Lu
2010-03-23  8:39 ` Yinghai Lu
2010-03-23  8:39 ` [PATCH 1/4] x86: do not free zero sized per cpu areas Yinghai Lu
2010-03-23  8:39   ` Yinghai Lu
2010-03-23  8:39 ` [PATCH 2/4] x86: add find_e820_area_node Yinghai Lu
2010-03-23  8:39   ` Yinghai Lu
2010-03-23  8:39 ` [PATCH 3/4] x86: add sanitize_e820_map Yinghai Lu
2010-03-23  8:39   ` Yinghai Lu
2010-03-23  8:39 ` [RFC PATCH -v2 4/4] x86: use lmb to replace early_res Yinghai Lu
2010-03-23  8:39   ` Yinghai Lu
2010-03-23  9:14   ` Ingo Molnar
2010-03-23 10:36   ` [RFC PATCH -v3 1/2] lmb: seperate region array from lmb_region struct Yinghai Lu
2010-03-23 10:36     ` Yinghai Lu
2010-03-23 10:42     ` Ingo Molnar
2010-03-23 13:18       ` Paul Mundt
2010-03-23 13:18         ` Paul Mundt
2010-03-23 17:17         ` Yinghai Lu [this message]
2010-03-23 18:13           ` Paul Mundt
2010-03-23 18:13             ` Paul Mundt
2010-03-24  4:45       ` Benjamin Herrenschmidt
2010-03-24  5:36         ` [RFC PATCH v4 " Yinghai Lu
2010-03-24  5:37         ` [RFC PATCH -v4 2/2] x86: use lmb to replace early_res Yinghai Lu
2010-03-24  5:46         ` [RFC PATCH -v3 1/2] lmb: seperate region array from lmb_region struct Yinghai Lu
2010-03-24  7:41           ` Benjamin Herrenschmidt
2010-03-23 15:07     ` Thomas Gleixner
2010-03-23 17:38       ` Yinghai Lu
2010-03-23 18:08         ` Ingo Molnar
2010-03-23 10:37   ` [RFC PATCH -v3 2/2] x86: use lmb to replace early_res Yinghai Lu
2010-03-23 10:37     ` Yinghai Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BA8F7BD.20401@kernel.org \
    --to=yinghai@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=hpa@zytor.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox