mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][next] btrfs: scrub: remove redundant division of stripe_nr
@ 2023-06-21 13:09 Colin Ian King
  2023-06-29 15:17 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2023-06-21 13:09 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba, linux-btrfs
  Cc: kernel-janitors, linux-kernel

Variable stripe_nr is being divided by map->num_stripes however the
result is never read. The division and assignment are redundant and
can be removed. Cleans up clang scan build warning:

fs/btrfs/scrub.c:1264:3: warning: Value stored to 'stripe_nr' is
never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/btrfs/scrub.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 2c7fdbb60314..8fc4f9ea3d20 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -1261,7 +1261,6 @@ static int get_raid56_logic_offset(u64 physical, int num,
 
 		/* Work out the disk rotation on this stripe-set */
 		rot = stripe_nr % map->num_stripes;
-		stripe_nr /= map->num_stripes;
 		/* calculate which stripe this data locates */
 		rot += i;
 		stripe_index = rot % map->num_stripes;
-- 
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] btrfs: scrub: remove redundant division of stripe_nr
  2023-06-21 13:09 [PATCH][next] btrfs: scrub: remove redundant division of stripe_nr Colin Ian King
@ 2023-06-29 15:17 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2023-06-29 15:17 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Chris Mason, Josef Bacik, David Sterba, linux-btrfs,
	kernel-janitors, linux-kernel

On Wed, Jun 21, 2023 at 02:09:37PM +0100, Colin Ian King wrote:
> Variable stripe_nr is being divided by map->num_stripes however the
> result is never read. The division and assignment are redundant and
> can be removed. Cleans up clang scan build warning:
> 
> fs/btrfs/scrub.c:1264:3: warning: Value stored to 'stripe_nr' is
> never read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Added to misc-next, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-29 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21 13:09 [PATCH][next] btrfs: scrub: remove redundant division of stripe_nr Colin Ian King
2023-06-29 15:17 ` David Sterba

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®