[patch 15/17] mpt fusion: shut up uninitialized variable warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



drivers/message/fusion/mptctl.c: In function â??mptctl_mpt_commandâ??:
drivers/message/fusion/mptctl.c:1764: warning: â??bufIn.lenâ?? may be used uninitialized in this function
drivers/message/fusion/mptctl.c:1765: warning: â??bufOut.lenâ?? may be used uninitialized in this function

come because gcc gets confused by some "goto" statements in above function.
 The warnings have been verified to be bogus, however, the function does
initialize these later (after the offending goto's) in the function anyway.
 So let's move those initializations to top of function, thereby also
shutting up these warnings.

Signed-off-by: Satyam Sharma <satyam@xxxxxxxxxxxxx>
Acked-by: Eric Moore <eric.moore@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/message/fusion/mptctl.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff -puN drivers/message/fusion/mptctl.c~mpt-fusion-shut-up-uninitialized-variable drivers/message/fusion/mptctl.c
--- a/drivers/message/fusion/mptctl.c~mpt-fusion-shut-up-uninitialized-variable
+++ a/drivers/message/fusion/mptctl.c
@@ -1774,7 +1774,10 @@ mptctl_do_mpt_command (struct mpt_ioctl_
 	ulong 		timeout;
 	struct scsi_device *sdev;
 
+	/* bufIn and bufOut are used for user to kernel space transfers
+	 */
 	bufIn.kptr = bufOut.kptr = NULL;
+	bufIn.len = bufOut.len = 0;
 
 	if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
 	    (ioc == NULL)) {
@@ -2108,11 +2111,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_
 	psge = (char *) (((int *) mf) + karg.dataSgeOffset);
 	flagsLength = 0;
 
-	/* bufIn and bufOut are used for user to kernel space transfers
-	 */
-	bufIn.kptr = bufOut.kptr = NULL;
-	bufIn.len = bufOut.len = 0;
-
 	if (karg.dataOutSize > 0)
 		sgSize ++;
 
_
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux