[PATCH -mm] drivers/md/: Shut up uninitialized variable warnings

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux Kernel Mailing List <linux-kernel@...>
Cc: Alasdair G Kergon <agk@...>, <dm-devel@...>
Date: Sunday, September 2, 2007 - 4:22 pm

drivers/md/dm-exception-store.c: In function $B!F(Jpersistent_read_metadata$B!G(J:
drivers/md/dm-exception-store.c:452: warning: $B!F(Jnew_snapshot$B!G(J may be used uninitialized in this function

drivers/md/dm-ioctl.c: In function $B!F(Jctl_ioctl$B!G(J:
drivers/md/dm-ioctl.c:1407: warning: $B!F(Jparam$B!G(J may be used uninitialized in this function

[ For these, I'd like to especially add -- shame on you, gcc! ]

drivers/md/dm-table.c: In function $B!F(Jdm_get_device$B!G(J:
drivers/md/dm-table.c:472: warning: $B!F(Jdev$B!G(J may be used uninitialized in this function

are all verified to be bogus warnings. Let's shut them up.

---

 drivers/md/dm-exception-store.c |    3 ++-
 drivers/md/dm-ioctl.c |    2 +-
 drivers/md/dm-table.c |    2 +-
 3 file changed, 4 insertions(+), 3 deletion(-)

--- linux-2.6.23-rc4-mm1/drivers/md/dm-exception-store.c~fix	2007-09-03 01:05:12.000000000 +0530
+++ linux-2.6.23-rc4-mm1/drivers/md/dm-exception-store.c	2007-09-03 01:11:37.000000000 +0530
@@ -449,7 +449,8 @@ static void persistent_destroy(struct ex
 
 static int persistent_read_metadata(struct exception_store *store)
 {
-	int r, new_snapshot;
+	int r;
+	int uninitialized_var(new_snapshot);
 	struct pstore *ps = get_info(store);
 
 	/*
--- linux-2.6.23-rc4-mm1/drivers/md/dm-ioctl.c~fix	2007-09-03 01:04:58.000000000 +0530
+++ linux-2.6.23-rc4-mm1/drivers/md/dm-ioctl.c	2007-09-03 01:07:04.000000000 +0530
@@ -1404,7 +1404,7 @@ static int ctl_ioctl(struct inode *inode
 {
 	int r = 0;
 	unsigned int cmd;
-	struct dm_ioctl *param;
+	struct dm_ioctl * uninitialized_var(param);
 	struct dm_ioctl __user *user = (struct dm_ioctl __user *) u;
 	ioctl_fn fn = NULL;
 	size_t param_size;
--- linux-2.6.23-rc4-mm1/drivers/md/dm-table.c~fix	2007-09-03 00:56:05.000000000 +0530
+++ linux-2.6.23-rc4-mm1/drivers/md/dm-table.c	2007-09-03 00:57:15.000000000 +0530
@@ -469,7 +469,7 @@ static int __table_get_device(struct dm_
 			      int mode, struct dm_dev **result)
 {
 	int r;
-	dev_t dev;
+	dev_t uninitialized_var(dev);
 	struct dm_dev *dd;
 	unsigned int major, minor;
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[-mm patchset] War on warnings, Satyam Sharma, (Sun Sep 2, 4:02 pm)
[PATCH -mm] drivers/md/: Shut up uninitialized variable warn..., Satyam Sharma, (Sun Sep 2, 4:22 pm)
[PATCH -mm] net/wireless/sysfs.c: Shut up build warning, Satyam Sharma, (Sun Sep 2, 4:11 pm)
[PATCH -mm] sisusbvga: Fix bug and build warnings, Satyam Sharma, (Sun Sep 2, 4:07 pm)
Re: [PATCH -mm] sisusbvga: Fix bug and build warnings, Satyam Sharma, (Sun Sep 2, 4:32 pm)
Re: [-mm patchset] War on warnings, Jesper Juhl, (Sun Sep 2, 4:04 pm)
Re: [-mm patchset] War on warnings, Satyam Sharma, (Sun Sep 2, 4:39 pm)