From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86/Dom0: minor command line parsing adjustments Date: Wed, 25 Feb 2015 16:34:05 +0000 Message-ID: <54EDF97D.7030700@citrix.com> References: <54EDEEAD0200007800063AA8@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YQeyN-0007Gq-1w for xen-devel@lists.xenproject.org; Wed, 25 Feb 2015 16:38:07 +0000 In-Reply-To: <54EDEEAD0200007800063AA8@mail.emea.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 , xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org On 25/02/15 14:47, Jan Beulich wrote: > Remove a redundant statement from parse_dom0_mem() and refuse bogus > ranges (with a separator other than a dash) passed to > parse_dom0_max_vcpus(). Fix coding style issues in the latter function > at the same time. > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper > > --- a/xen/arch/x86/domain_build.c > +++ b/xen/arch/x86/domain_build.c > @@ -78,8 +78,6 @@ static void __init parse_dom0_mem(const > dom0_max_nrpages = parse_amt(s+4, &s); > else > dom0_nrpages = parse_amt(s, &s); > - if ( *s != ',' ) > - break; > } while ( *s++ == ',' ); > } > custom_param("dom0_mem", parse_dom0_mem); > @@ -89,14 +87,14 @@ static unsigned int __initdata opt_dom0_ > > static void __init parse_dom0_max_vcpus(const char *s) > { > - if (*s == '-') /* -M */ > + if ( *s == '-' ) /* -M */ > opt_dom0_max_vcpus_max = simple_strtoul(s + 1, &s, 0); > - else /* N, N-, or N-M */ > + else /* N, N-, or N-M */ > { > opt_dom0_max_vcpus_min = simple_strtoul(s, &s, 0); > - if (*s++ == '\0') /* N */ > + if ( !*s ) /* N */ > opt_dom0_max_vcpus_max = opt_dom0_max_vcpus_min; > - else if (*s != '\0') /* N-M */ > + else if ( *s++ == '-' && *s ) /* N-M */ > opt_dom0_max_vcpus_max = simple_strtoul(s, &s, 0); > } > } > > >