mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Enrico Jorns <ejo@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/5] commands: nv: argc cannot be < 1
Date: Thu, 14 Sep 2017 08:27:54 +0200	[thread overview]
Message-ID: <20170914062754.ssohtnuhds4rpav3@pengutronix.de> (raw)
In-Reply-To: <20170913122332.17585-2-ejo@pengutronix.de>

On Wed, Sep 13, 2017 at 02:23:28PM +0200, Enrico Jorns wrote:
> argc == 1 will only contain the name of the program itself which must be
> present when invoking nv command code.

This reasoning is not quite right. You miss the argc -= optind above the
argc < 1 test. In fact in patch 4/5 you re-add the same test again
(written as argc == 0 this time).

Shouldn't this patch simply be merged with 4/5?

Sascha

> 
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
> ---
>  commands/nv.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/commands/nv.c b/commands/nv.c
> index 37cdb96647..eb396bfd9b 100644
> --- a/commands/nv.c
> +++ b/commands/nv.c
> @@ -55,9 +55,6 @@ static int do_nv(int argc, char *argv[])
>  	argc -= optind;
>  	argv += optind;
>  
> -	if (argc < 1)
> -		return COMMAND_ERROR_USAGE;
> -
>  	for (i = 0; i < argc; i++) {
>  		value = strchr(argv[0], '=');
>  		if (value) {
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-09-14  6:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-13 12:23 [PATCH 0/5] Fixes for nv command handling Enrico Jorns
2017-09-13 12:23 ` [PATCH 1/5] commands: nv: argc cannot be < 1 Enrico Jorns
2017-09-14  6:27   ` Sascha Hauer [this message]
2017-09-14  7:28     ` Enrico Joerns
2017-09-13 12:23 ` [PATCH 2/5] commands: nv: call nvvar_print() only if no argument is given Enrico Jorns
2017-09-13 12:23 ` [PATCH 3/5] commands: nv: assure error code will be returned when an error occurred Enrico Jorns
2017-09-13 12:23 ` [PATCH 4/5] commands: nv: fail if required var arguments are missing Enrico Jorns
2017-09-13 12:23 ` [PATCH 5/5] common: globvar: let nvvar_remove() report non-existing variable Enrico Jorns
2017-09-13 13:06 ` [PATCH] commands: nv: adjust command help Enrico Jorns

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=20170914062754.ssohtnuhds4rpav3@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=ejo@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox