linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Cc: Yauhen Kharuzhy <yauhen.kharuzhy@zavadatar.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Fix broken 'device scan' arguments parsing
Date: Wed, 9 Mar 2016 14:19:18 +0100	[thread overview]
Message-ID: <20160309131918.GD738@twin.jikos.cz> (raw)
In-Reply-To: <56DFDDB0.5090207@jp.fujitsu.com>

On Wed, Mar 09, 2016 at 05:24:16PM +0900, Satoru Takeuchi wrote:
> > --- a/cmds-device.c
> > +++ b/cmds-device.c
> > @@ -273,7 +273,7 @@ static int cmd_device_scan(int argc, char **argv)
> >   	if (all && check_argc_max(argc - optind, 1))
> 
> It's better to the above line as follows.
> 
> ========
> 	if (all && check_argc_exact(argc - optind, 0))

check_argc_exact prints error messages, and is usually followed by
the usage() call that exits. In the condition it's supposed to check if
there are no arguments (ie. scan all) or if the -d option was given
(scan all). The validity of the option combinations should be done
before that, so the patch is IMO correct.

  reply	other threads:[~2016-03-09 13:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09  1:19 [PATCH] Fix broken 'device scan' arguments parsing Yauhen Kharuzhy
2016-03-09  8:24 ` Satoru Takeuchi
2016-03-09 13:19   ` David Sterba [this message]
2016-03-09 13:35 ` David Sterba

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=20160309131918.GD738@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=takeuchi_satoru@jp.fujitsu.com \
    --cc=yauhen.kharuzhy@zavadatar.com \
    /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;
as well as URLs for NNTP newsgroup(s).