mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yu Kuai <yukuai1@huaweicloud.com>
To: Tom Rix <trix@redhat.com>,
	song@kernel.org, nathan@kernel.org, ndesaulniers@google.com
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev, "yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH] md/raid5: remove unused working_disks variable
Date: Mon, 27 Mar 2023 09:37:05 +0800	[thread overview]
Message-ID: <afd9db2f-72af-8ac0-9ab1-655fc79d992e@huaweicloud.com> (raw)
In-Reply-To: <20230326125637.1352895-1-trix@redhat.com>

Hi,

在 2023/03/26 20:56, Tom Rix 写道:
> clang with W=1 reports
> drivers/md/raid5.c:7719:6: error: variable 'working_disks'
>    set but not used [-Werror,-Wunused-but-set-variable]
>          int working_disks = 0;
>              ^
> This variable is not used so remove it.

Other than some nits below, this patch looks good to me, feel free to
add:

Reviewed-by: Yu Kuai <yukuai3@huawei.com>

Please also mention that commit 908f4fbd2657 ("md/raid5: be more
thorough in calculating 'degraded' value.") remove the last reference.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>   drivers/md/raid5.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 7b820b81d8c2..2b1e78c46817 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -7716,7 +7716,6 @@ static void raid5_set_io_opt(struct r5conf *conf)
>   static int raid5_run(struct mddev *mddev)
>   {
>   	struct r5conf *conf;
> -	int working_disks = 0;
>   	int dirty_parity_disks = 0;
>   	struct md_rdev *rdev;
>   	struct md_rdev *journal_dev = NULL;
> @@ -7913,7 +7912,6 @@ static int raid5_run(struct mddev *mddev)
>   			goto abort;
>   		}
>   		if (test_bit(In_sync, &rdev->flags)) {
> -			working_disks++;
Please remove the braces as well,

Thanks,
Kuai
>   			continue;
>   		}
>   		/* This disc is not fully in-sync.  However if it
> 


      reply	other threads:[~2023-03-27  1:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26 12:56 Tom Rix
2023-03-27  1:37 ` Yu Kuai [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=afd9db2f-72af-8ac0-9ab1-655fc79d992e@huaweicloud.com \
    --to=yukuai1@huaweicloud.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=song@kernel.org \
    --cc=trix@redhat.com \
    --cc=yukuai3@huawei.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

all inboxes | Powered by JetHome®