From: Keir Fraser Subject: Re: [PATCH v8 1/2] hypervisor: XENMEM_claim_pages (subop of existing) hypercall Date: Thu, 29 Nov 2012 09:29:48 +0000 Message-ID: References: <50B725ED02000078000AC624@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <50B725ED02000078000AC624@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , Dan Magenheimer Cc: Ian Campbell , Konrad Rzeszutek Wilk , AndresLagar-Cavilla , Matthew Daley , TimDeegan , xen-devel@lists.xen.org, Zhigang Wang List-Id: xen-devel@lists.xenproject.org On 29/11/2012 08:07, "Jan Beulich" wrote: >>>> On 28.11.12 at 19:05, Dan Magenheimer wrote: >>> From: Jan Beulich [mailto:JBeulich@suse.com] >>> Perhaps then even invert the if() >>> condition and have just a single return point. >> >> Rather than invert the if(), unless you prefer the extra >> level of indentation, I'd prefer: >> >> + d->tot_pages += pages; >> + if ( !d->unclaimed_pages ) >> + goto out; >> >> +out: >> + return d->tot_pages; >> >> Would that be acceptable? > > Acceptable as per the coding guidelines - yes. But I personally > dislike goto-s (and would hence prefer the extra level of > indentation, considering that this is a strait code block with no > deep nesting of inner scopes). Personally I think I prefer the bailing goto, as I like straightline code with no indentation where possible. But it is personal preference for a function this short. Either is perfectly acceptable. -- Keir > Jan > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel