Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030216AbWCQRUc (ORCPT ); Fri, 17 Mar 2006 12:20:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030217AbWCQRUc (ORCPT ); Fri, 17 Mar 2006 12:20:32 -0500 Received: from e4.ny.us.ibm.com ([32.97.182.144]:29410 "EHLO e4.ny.us.ibm.com") by vger.kernel.org with ESMTP id S1030216AbWCQRUb (ORCPT ); Fri, 17 Mar 2006 12:20:31 -0500 Subject: Re: [PATCH: 009/017]Memory hotplug for new nodes v.4.(add return code init_currently_empty_zone) From: Dave Hansen To: Yasunori Goto Cc: Andrew Morton , "Luck, Tony" , Andi Kleen , Linux Kernel ML , linux-ia64@vger.kernel.org, linux-mm In-Reply-To: <20060317163404.C649.Y-GOTO@jp.fujitsu.com> References: <20060317163404.C649.Y-GOTO@jp.fujitsu.com> Content-Type: text/plain Date: Fri, 17 Mar 2006 09:19:11 -0800 Message-Id: <1142615951.10906.70.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1446 Lines: 38 On Fri, 2006-03-17 at 17:22 +0900, Yasunori Goto wrote: > --- pgdat8.orig/mm/memory_hotplug.c 2006-03-16 16:05:38.000000000 +0900 > +++ pgdat8/mm/memory_hotplug.c 2006-03-16 16:45:30.000000000 +0900 > @@ -26,16 +26,23 @@ > > extern void zonetable_add(struct zone *zone, int nid, int zid, unsigned long pfn, > unsigned long size); > -static void __add_zone(struct zone *zone, unsigned long phys_start_pfn) > +static int __add_zone(struct zone *zone, unsigned long phys_start_pfn) > { > struct pglist_data *pgdat = zone->zone_pgdat; > int nr_pages = PAGES_PER_SECTION; > int nid = pgdat->node_id; > int zone_type; > + int ret = 0; > > zone_type = zone - pgdat->node_zones; > + if (!populated_zone(zone)) { > + ret = init_currently_empty_zone(zone, phys_start_pfn, nr_pages); > + if (ret < 0) > + return ret; > + } > memmap_init_zone(nr_pages, nid, zone_type, phys_start_pfn); > zonetable_add(zone, nid, zone_type, phys_start_pfn, nr_pages); > + return 0; > } Minor nit: If you're going to introduce a top-level 'ret' variable, it is probably best to just use it everywhere. In this case, you only use it inside of that if(), so you _could_ declare it in there. -- Dave - 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/