mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] stripe_to_pdidx() cleanup
@ 2006-05-02 12:18 Coywolf Qi Hunt
  0 siblings, 0 replies; only message in thread
From: Coywolf Qi Hunt @ 2006-05-02 12:18 UTC (permalink / raw)
  To: akpm; +Cc: linux-raid, linux-kernel, neilb

Hello,

Cleanup: Remove unnecessary variable x in stripe_to_pdidx().

Signed-off-by: Coywolf Qi Hunt <qiyong@freeforge.net>
---

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 3184360..7df6840 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1033,13 +1033,12 @@ static void end_reshape(raid5_conf_t *co
 
 static int stripe_to_pdidx(sector_t stripe, raid5_conf_t *conf, int disks)
 {
-	int sectors_per_chunk = conf->chunk_size >> 9;
-	sector_t x = stripe;
 	int pd_idx, dd_idx;
-	int chunk_offset = sector_div(x, sectors_per_chunk);
-	stripe = x;
-	raid5_compute_sector(stripe*(disks-1)*sectors_per_chunk
-			     + chunk_offset, disks, disks-1, &dd_idx, &pd_idx, conf);
+	int sectors_per_chunk = conf->chunk_size >> 9;
+	int chunk_offset = sector_div(stripe, sectors_per_chunk);
+
+	raid5_compute_sector(stripe*(disks-1)*sectors_per_chunk + chunk_offset,
+				disks, disks-1, &dd_idx, &pd_idx, conf);
 	return pd_idx;
 }
 

-- 
Coywolf Qi Hunt

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-02 12:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-02 12:18 [patch] stripe_to_pdidx() cleanup Coywolf Qi Hunt

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®