Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755608AbYJBVv7 (ORCPT ); Thu, 2 Oct 2008 17:51:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755230AbYJBVvt (ORCPT ); Thu, 2 Oct 2008 17:51:49 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:45112 "EHLO e31.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754500AbYJBVvs (ORCPT ); Thu, 2 Oct 2008 17:51:48 -0400 Message-ID: <48E5428E.8080402@linux.vnet.ibm.com> Date: Thu, 02 Oct 2008 16:52:14 -0500 From: Jon Tollefson Organization: IBM User-Agent: Thunderbird 2.0.0.17 (X11/20080925) MIME-Version: 1.0 To: Adam Litke CC: linuxppc-dev , Linux Memory Management List , Linux Kernel Mailing List , Adam Litke Subject: Re: [PATCH] properly reserve in bootmem the lmb reserved regions that cross numa nodes References: <48E23D6C.4030406@linux.vnet.ibm.com> <1222789675.13978.14.camel@localhost.localdomain> In-Reply-To: <1222789675.13978.14.camel@localhost.localdomain> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1873 Lines: 64 Adam Litke wrote: > This seems like the right approach to me. I have pointed out a few > stylistic issues below. > Thanks. I'll make those changes. I assume by __mminit you meant __meminit Jon > On Tue, 2008-09-30 at 09:53 -0500, Jon Tollefson wrote: > > >> + /* Mark reserved regions */ >> + for (i = 0; i < lmb.reserved.cnt; i++) { >> + unsigned long physbase = lmb.reserved.region[i].base; >> + unsigned long size = lmb.reserved.region[i].size; >> + unsigned long start_pfn = physbase >> PAGE_SHIFT; >> + unsigned long end_pfn = ((physbase+size-1) >> PAGE_SHIFT); >> > > CodingStyle dictates that this should be: > unsigned long end_pfn = ((physbase + size - 1) >> PAGE_SHIFT); > > > > >> +/** >> + * get_node_active_region - Return active region containing start_pfn >> + * @start_pfn The page to return the region for. >> + * >> + * It will return NULL if active region is not found. >> + */ >> +struct node_active_region *get_node_active_region( >> + unsigned long start_pfn) >> > > Bad style. I think the convention would be to write it like this: > > struct node_active_region * > get_node_active_region(unsigned long start_pfn) > > >> +{ >> + int i; >> + for (i = 0; i < nr_nodemap_entries; i++) { >> + unsigned long node_start_pfn = early_node_map[i].start_pfn; >> + unsigned long node_end_pfn = early_node_map[i].end_pfn; >> + >> + if (node_start_pfn <= start_pfn && node_end_pfn > start_pfn) >> + return &early_node_map[i]; >> + } >> + return NULL; >> +} >> > > Since this is using the early_node_map[], should we mark the function > __mminit? > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/