* [PATCH] md/raid5: remove unused working_disks variable
@ 2023-03-26 12:56 Tom Rix
2023-03-27 1:37 ` Yu Kuai
0 siblings, 1 reply; 2+ messages in thread
From: Tom Rix @ 2023-03-26 12:56 UTC (permalink / raw)
To: song, nathan, ndesaulniers; +Cc: linux-raid, linux-kernel, llvm, 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.
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++;
continue;
}
/* This disc is not fully in-sync. However if it
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] md/raid5: remove unused working_disks variable
2023-03-26 12:56 [PATCH] md/raid5: remove unused working_disks variable Tom Rix
@ 2023-03-27 1:37 ` Yu Kuai
0 siblings, 0 replies; 2+ messages in thread
From: Yu Kuai @ 2023-03-27 1:37 UTC (permalink / raw)
To: Tom Rix, song, nathan, ndesaulniers
Cc: linux-raid, linux-kernel, llvm, yukuai (C)
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-27 1:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-26 12:56 [PATCH] md/raid5: remove unused working_disks variable Tom Rix
2023-03-27 1:37 ` Yu Kuai
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.