From: Ian Campbell Subject: Re: [PATCH v3 6/8] tools: arm: refactor code to setup guest p2m and fill it with RAM Date: Fri, 2 May 2014 16:34:08 +0100 Message-ID: <1399044848.18944.20.camel@kazak.uk.xensource.com> References: <1398690109.29700.82.camel@kazak.uk.xensource.com> <1398690132-5651-6-git-send-email-ian.campbell@citrix.com> <21347.44747.817900.560825@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21347.44747.817900.560825@mariner.uk.xensource.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: Ian Jackson Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, julien.grall@linaro.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, 2014-05-02 at 15:42 +0100, Ian Jackson wrote: > Ian Campbell writes ("[PATCH v3 6/8] tools: arm: refactor code to setup guest p2m and fill it with RAM"): > ... > > +static int populate_guest_memory(struct xc_dom_image *dom, > > + xen_pfn_t base_pfn, xen_pfn_t nr_pfns) > > +{ > > + int rc; > > + xen_pfn_t allocsz, pfn; > > + > > + if (!nr_pfns) > > + return 0; > > Why bother with this early return ? Mainly it just avoids the DOMPRINTF, which once we add a second bank would be redundant a lot of the time. Ian.