From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751423Ab1CDHIS (ORCPT ); Fri, 4 Mar 2011 02:08:18 -0500 Received: from mx2.mail.elte.hu ([157.181.151.9]:36320 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750809Ab1CDHIR (ORCPT ); Fri, 4 Mar 2011 02:08:17 -0500 Date: Fri, 4 Mar 2011 08:08:02 +0100 From: Ingo Molnar To: David Rientjes Cc: Yinghai Lu , Cyrill Gorcunov , Tejun Heo , Ingo Molnar , "H. Peter Anvin" , tglx@linutronix.de, brgerst@gmail.com, shaohui.zheng@intel.com, linux-kernel@vger.kernel.org Subject: Re: [patch] x86, mm: Clean up initmem_init Message-ID: <20110304070802.GA27618@elte.hu> References: <20110221083511.GC31267@htj.dyndns.org> <4D700B93.2080807@gmail.com> <4D701015.2040703@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-17) X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.3.1 -2.0 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * David Rientjes wrote: > On Thu, 3 Mar 2011, Yinghai Lu wrote: > > > he want > > > > > +#ifdef CONFIG_ACPI_NUMA > > >> > + ret = numa_init(x86_acpi_numa_init); > > >> > + if (!ret) > > >> > + return; > > >> > +#endif > > >> > +#ifdef CONFIG_AMD_NUMA > > >> > + ret = numa_init(amd_numa_init); > > >> > + if (!ret) > > >> > + return; > > >> > +#endif > > > > to be replaced by: > > > > > +#ifdef CONFIG_ACPI_NUMA > > >> > + if (!numa_init(x86_acpi_numa_init)) > > >> > + return; > > >> > +#endif > > >> > +#ifdef CONFIG_AMD_NUMA > > >> > + if (!numa_init(amd_numa_init)) > > >> > + return; > > >> > +#endif > > It's a matter of style and I think it's up to Ingo what he'd prefer to > see. I think your variant is cleaner: hiding function call side-effects in conditionscan be a fragile thing to do. We want constant expressions with no side-effects - so if functions are called they should be constant functions as well. Code compactness isn't everything - if it was we'd be using C to the max to create unreadable compound expressions all the time. Thanks, Ingo