From: "Jan Beulich" Subject: [PATCH] x86/Dom0: minor command line parsing adjustments Date: Wed, 25 Feb 2015 14:47:57 +0000 Message-ID: <54EDEEAD0200007800063AA8@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartBC89088D.1__=" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YQdFn-0000Fk-Pf for xen-devel@lists.xenproject.org; Wed, 25 Feb 2015 14:47:59 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Andrew Cooper , Keir Fraser List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartBC89088D.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 --- 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=20 dom0_max_nrpages =3D parse_amt(s+4, &s); else dom0_nrpages =3D parse_amt(s, &s); - if ( *s !=3D ',' ) - break; } while ( *s++ =3D=3D ',' ); } custom_param("dom0_mem", parse_dom0_mem); @@ -89,14 +87,14 @@ static unsigned int __initdata opt_dom0_ =20 static void __init parse_dom0_max_vcpus(const char *s) { - if (*s =3D=3D '-') /* -M */ + if ( *s =3D=3D '-' ) /* -M */ opt_dom0_max_vcpus_max =3D simple_strtoul(s + 1, &s, 0); - else /* N, N-, or N-M */ + else /* N, N-, or N-M */ { opt_dom0_max_vcpus_min =3D simple_strtoul(s, &s, 0); - if (*s++ =3D=3D '\0') /* N */ + if ( !*s ) /* N */ opt_dom0_max_vcpus_max =3D opt_dom0_max_vcpus_min; - else if (*s !=3D '\0') /* N-M */ + else if ( *s++ =3D=3D '-' && *s ) /* N-M */ opt_dom0_max_vcpus_max =3D simple_strtoul(s, &s, 0); } } --=__PartBC89088D.1__= Content-Type: text/plain; name="x86-Dom0-parse.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-Dom0-parse.patch" x86/Dom0: minor command line parsing adjustments=0A=0ARemove a redundant = statement from parse_dom0_mem() and refuse bogus=0Aranges (with a = separator other than a dash) passed to=0Aparse_dom0_max_vcpus(). Fix = coding style issues in the latter function=0Aat the same time.=0A=0ASigned-= off-by: Jan Beulich =0A=0A--- a/xen/arch/x86/domain_buil= d.c=0A+++ b/xen/arch/x86/domain_build.c=0A@@ -78,8 +78,6 @@ static void = __init parse_dom0_mem(const =0A dom0_max_nrpages =3D parse_amt(= s+4, &s);=0A else=0A dom0_nrpages =3D parse_amt(s, = &s);=0A- if ( *s !=3D ',' )=0A- break;=0A } while ( = *s++ =3D=3D ',' );=0A }=0A custom_param("dom0_mem", parse_dom0_mem);=0A@@ = -89,14 +87,14 @@ static unsigned int __initdata opt_dom0_=0A =0A static = void __init parse_dom0_max_vcpus(const char *s)=0A {=0A- if (*s =3D=3D = '-') /* -M */=0A+ if ( *s =3D=3D '-' ) = /* -M */=0A opt_dom0_max_vcpus_max =3D simple_strtoul(s + 1, &s, = 0);=0A- else /* N, N-, or N-M */=0A+ else = /* N, N-, or N-M */=0A {=0A = opt_dom0_max_vcpus_min =3D simple_strtoul(s, &s, 0);=0A- if (*s++ = =3D=3D '\0') /* N */=0A+ if ( !*s ) /* N = */=0A opt_dom0_max_vcpus_max =3D opt_dom0_max_vcpus_min;=0A- = else if (*s !=3D '\0') /* N-M */=0A+ else if ( *s++ =3D=3D = '-' && *s ) /* N-M */=0A opt_dom0_max_vcpus_max =3D simple_strt= oul(s, &s, 0);=0A }=0A }=0A --=__PartBC89088D.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartBC89088D.1__=--