From: Bob Picco <bob.picco@hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [patch 4/4] ia64 SPARSEMEM - SPARSEMEM code changes
Date: Mon, 23 May 2005 21:20:49 +0000 [thread overview]
Message-ID: <20050523212049.GJ2783@localhost.localdomain> (raw)
In-Reply-To: <20050523175117.GG2783@localhost.localdomain>
Jesse Barnes wrote: [Mon May 23 2005, 02:08:28PM EDT]
> On Monday, May 23, 2005 10:51 am, Bob Picco wrote:
> > +#ifdef CONFIG_SPARSEMEM
> > +/**
> > + * register_sparse_mem - notify SPARSEMEM that this memory range
> > exists. + * @start: physical start of range
> > + * @end: physical end of range
> > + * @arg: unused
> > + *
> > + */
>
> No comment for the function (I guess it's pretty simple...).
I went ahead and added one despite its simplicity.
>
> > +static int __init register_sparse_mem(unsigned long start, unsigned
> > long end, + void *arg)
> > +{
> > + int nid;
> > +
> > + start = __pa(start) >> PAGE_SHIFT;
> > + end = __pa(end) >> PAGE_SHIFT;
> > + nid = early_pfn_to_nid(start);
> > + (void) memory_present(nid, start, end);
>
> Is the (void) cast necessary?
At one time it was required but no longer true.
>
> > +#ifdef CONFIG_SPARSEMEM
> > + efi_memmap_walk(register_sparse_mem, (void *) 0);
> > +#endif
>
> NULL here instead?
okay
>
> > -#ifndef CONFIG_DISCONTIGMEM
> > +#ifndef CONFIG_NEED_MULTIPLE_NODES
okay
>
> Just use a space instead of a tab I think.
>
> > +#if defined(CONFIG_SPARSEMEM) && defined(CONFIG_NUMA)
>
> Ditto.
okay
>
> > +/*
> > + * Because of holes evaluate on section limits.
> > + */
>
> A better comment block here maybe describing return values and such?
Yep
>
> > +int early_pfn_to_nid(unsigned long pfn)
> > +{
> > + int i, section = pfn >> PFN_SECTION_SHIFT, ssec, esec;
> > +
> > + for (i = 0; i < num_node_memblks; i++) {
> > + ssec = node_memblk[i].start_paddr >> PA_SECTION_SHIFT;
> > + esec = (node_memblk[i].start_paddr + node_memblk[i].size +
> > + ((1L << PA_SECTION_SHIFT) - 1)) >> PA_SECTION_SHIFT;
> > + if (section >= ssec && section < esec)
> > + break;
> > + }
> > +
> > + if (i = num_node_memblks)
> > + return 0;
> > + else
> > + return node_memblk[i].nid;
>
> You could just drop the else here if you wanted, maybe along with a
> comment by the return 0 saying that the pfn wasn't found? Or you could
> turn the 'break' above into return node_memblk[i].nid and make the
> function return 0 unconditionally if the for loop exited.
Yes I agree.
>
> So other than that cosmetic stuff, this patch looks ok.
>
> Jesse
Jesse,
Thanks for the review. I'll respin a version 2 of the patchset very soon.
> -
bob
prev parent reply other threads:[~2005-05-23 21:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-23 17:51 [patch 4/4] ia64 SPARSEMEM - SPARSEMEM code changes Bob Picco
2005-05-23 18:08 ` Jesse Barnes
2005-05-23 21:20 ` Bob Picco [this message]
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=20050523212049.GJ2783@localhost.localdomain \
--to=bob.picco@hp.com \
--cc=linux-ia64@vger.kernel.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