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: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] btrfs-progs: Remove unnecessary variable devstart from cmd_device_scan()
Date: Thu, 10 Mar 2016 14:27:44 +0100	[thread overview]
Message-ID: <20160310132744.GG18908@twin.jikos.cz> (raw)
In-Reply-To: <56E0AC1B.3020405@jp.fujitsu.com>

On Thu, Mar 10, 2016 at 08:04:59AM +0900, Satoru Takeuchi wrote:
> It's unnecessary since it's always 1.
> 
> Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
> ---
> This patch can be applied to devel (commit b2bdd0da8969).
> ---
>  cmds-device.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/cmds-device.c b/cmds-device.c
> index cb470af..78d6535 100644
> --- a/cmds-device.c
> +++ b/cmds-device.c
> @@ -246,7 +246,6 @@ static const char * const cmd_device_scan_usage[] = {
>  static int cmd_device_scan(int argc, char **argv)
>  {
>  	int i;
> -	int devstart = 1;
>  	int all = 0;
>  	int ret = 0;
> 
> @@ -282,7 +281,7 @@ static int cmd_device_scan(int argc, char **argv)
>  		goto out;
>  	}
> 
> -	for( i = devstart ; i < argc ; i++ ){
> +	for (i = 1; i < argc; i++) {

Actually it needs to be set to optind before the for cycle, otherwise:

  # btrfs device scan -- /dev/sda
  ERROR: not a block device: --

  parent reply	other threads:[~2016-03-10 13:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 23:04 [PATCH 1/2] btrfs-progs: Remove unnecessary variable devstart from cmd_device_scan() Satoru Takeuchi
2016-03-09 23:08 ` [PATCH 2/2] btrfs-progs: Describe device scan -d is a deprecated option in manpage Satoru Takeuchi
2016-03-10 13:36   ` David Sterba
2016-03-10 13:27 ` David Sterba [this message]
2016-03-10 23:18   ` [PATCH 1/2] btrfs-progs: Remove unnecessary variable devstart from cmd_device_scan() Satoru Takeuchi

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=20160310132744.GG18908@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=takeuchi_satoru@jp.fujitsu.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).