Skip to contentSkip to conversation

MD RAID10: Fix compiler warning.

PATCH Applied Jonathan Brassow 2 participants 2 messages Jun 26, 2012 – Jul 4, 2012 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MD RAID10: Fix compiler warning.

MD RAID10: Fix compiler warning.

Initialize variable to prevent compiler warning.

drivers/md/raid10.c +1 -1
Index: linux-upstream/drivers/md/raid10.c
===================================================================
@@ -717,7 +717,7 @@ static struct md_rdev *read_balance(stru
 	int sectors = r10_bio->sectors;
 	int best_good_sectors;
 	sector_t new_distance, best_dist;
-	struct md_rdev *rdev, *best_rdev;
+	struct md_rdev *best_rdev, *rdev = NULL;
 	int do_balance;
 	int best_slot;
 	struct geom *geo = &conf->geo;
Applied
#1 lore raw
Quoted 12 lines · On Tue, 26 Jun 2012 03:40:13 -0500 Jonathan Brassow <[email protected]> wrote:

MD RAID10: Fix compiler warning.

Initialize variable to prevent compiler warning.

Index: linux-upstream/drivers/md/raid10.c
===================================================================

drivers/md/raid10.c static struct md_rdev *read_balance(stru · line 723

Quoted 8 lines
drivers/md/raid10.c +1 -1
@@ -717,7 +717,7 @@ static struct md_rdev *read_balance(stru
 	int sectors = r10_bio->sectors;
 	int best_good_sectors;
 	sector_t new_distance, best_dist;
-	struct md_rdev *rdev, *best_rdev;
+	struct md_rdev *best_rdev, *rdev = NULL;
 	int do_balance;
 	int best_slot;
 	struct geom *geo = &conf->geo;

Applied, thanks.
I'm fairly sure it is a bogus warning, but initializing to NULL won't hurt.

Thanks,
NeilBrown