aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2017-10-11 06:46:54 -0400
committerShaohua Li <shli@fb.com>2017-10-16 22:06:37 -0400
commita0e764c54382be8da96f83bcecc9cf26de3846dc (patch)
treee3bee83b7af781e5771e60e744e8d9f198141aff
parent935fe0983e09f4f7331ebf5ea4ae2124f6e9f9e8 (diff)
md: raid10: remove a couple of redundant variables and initializations
Variables dev and bio_last_sector are assigned values that are never read and hence these are redundant variables and can be removed. Also remove the duplicated initialization of sectors, the latter assignment is identical to the first and can be removed. Cleans up 3 clang build warnings: Value stored to 'dev' is never read Value stored to 'bio_last_sector' is never read Value stored to 'sectors' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Shaohua Li <shli@fb.com>
-rw-r--r--drivers/md/raid10.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 862cbd162e1c..b0de5b5ee689 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -383,12 +383,11 @@ static void raid10_end_read_request(struct bio *bio)
383{ 383{
384 int uptodate = !bio->bi_status; 384 int uptodate = !bio->bi_status;
385 struct r10bio *r10_bio = bio->bi_private; 385 struct r10bio *r10_bio = bio->bi_private;
386 int slot, dev; 386 int slot;
387 struct md_rdev *rdev; 387 struct md_rdev *rdev;
388 struct r10conf *conf = r10_bio->mddev->private; 388 struct r10conf *conf = r10_bio->mddev->private;
389 389
390 slot = r10_bio->read_slot; 390 slot = r10_bio->read_slot;
391 dev = r10_bio->devs[slot].devnum;
392 rdev = r10_bio->devs[slot].rdev; 391 rdev = r10_bio->devs[slot].rdev;
393 /* 392 /*
394 * this branch is our 'one mirror IO has finished' event handler: 393 * this branch is our 'one mirror IO has finished' event handler:
@@ -748,7 +747,6 @@ static struct md_rdev *read_balance(struct r10conf *conf,
748 747
749 raid10_find_phys(conf, r10_bio); 748 raid10_find_phys(conf, r10_bio);
750 rcu_read_lock(); 749 rcu_read_lock();
751 sectors = r10_bio->sectors;
752 best_slot = -1; 750 best_slot = -1;
753 best_rdev = NULL; 751 best_rdev = NULL;
754 best_dist = MaxSector; 752 best_dist = MaxSector;
@@ -2575,7 +2573,6 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
2575 struct bio *bio; 2573 struct bio *bio;
2576 struct r10conf *conf = mddev->private; 2574 struct r10conf *conf = mddev->private;
2577 struct md_rdev *rdev = r10_bio->devs[slot].rdev; 2575 struct md_rdev *rdev = r10_bio->devs[slot].rdev;
2578 sector_t bio_last_sector;
2579 2576
2580 /* we got a read error. Maybe the drive is bad. Maybe just 2577 /* we got a read error. Maybe the drive is bad. Maybe just
2581 * the block and we can fix it. 2578 * the block and we can fix it.
@@ -2586,7 +2583,6 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
2586 * frozen. 2583 * frozen.
2587 */ 2584 */
2588 bio = r10_bio->devs[slot].bio; 2585 bio = r10_bio->devs[slot].bio;
2589 bio_last_sector = r10_bio->devs[slot].addr + rdev->data_offset + r10_bio->sectors;
2590 bio_put(bio); 2586 bio_put(bio);
2591 r10_bio->devs[slot].bio = NULL; 2587 r10_bio->devs[slot].bio = NULL;
2592 2588