All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Keir Fraser <keir@xen.org>
Subject: Re: [PATCH] x86/Dom0: minor command line parsing adjustments
Date: Wed, 25 Feb 2015 16:34:05 +0000	[thread overview]
Message-ID: <54EDF97D.7030700@citrix.com> (raw)
In-Reply-To: <54EDEEAD0200007800063AA8@mail.emea.novell.com>

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 <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- 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);
>      }
>  }
>
>
>

      reply	other threads:[~2015-02-25 16:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 14:47 [PATCH] x86/Dom0: minor command line parsing adjustments Jan Beulich
2015-02-25 16:34 ` Andrew Cooper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54EDF97D.7030700@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.