From: Ian Campbell Subject: Re: [RFC 04/14] xen/arm: next_module: Skip module if the size is 0 Date: Fri, 14 Mar 2014 17:19:24 +0000 Message-ID: <1394817564.6065.6.camel@kazak.uk.xensource.com> References: <1394640969-25583-1-git-send-email-julien.grall@linaro.org> <1394640969-25583-5-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WOVlZ-0002ZP-5Z for xen-devel@lists.xenproject.org; Fri, 14 Mar 2014 17:19:29 +0000 In-Reply-To: <1394640969-25583-5-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Wed, 2014-03-12 at 16:15 +0000, Julien Grall wrote: > When the the module size is 0, it means that the module was not provided by > the user. It can happen, if the user choose to boot without initrd. > > In this case, both fields (start and size) are zeroed. Therefore, next_module > will return 0 every time if there is other non-zero module after this one. It > will happend "happen" or better "This can happen" > when the XSM module will be added. s/will be/is/ > Signed-off-by: Julien Grall Acked-by: Ian Campbell > --- > xen/arch/arm/setup.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c > index 959744e..31d853d 100644 > --- a/xen/arch/arm/setup.c > +++ b/xen/arch/arm/setup.c > @@ -281,6 +281,9 @@ static paddr_t __init next_module(paddr_t s, paddr_t *end) > paddr_t mod_s = mi->module[i].start; > paddr_t mod_e = mod_s + mi->module[i].size; > > + if ( !mi->module[i].size ) > + continue; > + > if ( mod_s < s ) > continue; > if ( mod_s > lowest )