Skip to content

Commit

Permalink
[SCSI] mptctl : shutup uninitialized variable warnings
Browse files Browse the repository at this point in the history
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: Eric Moore <[email protected]>
Signed-off-by: Satyam Sharma <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
Eric Moore authored and James Bottomley committed Oct 12, 2007
1 parent e1fc2b5 commit ab37128
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/message/fusion/mptctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,10 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
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)) {
Expand Down Expand Up @@ -2108,11 +2111,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
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 ++;

Expand Down

0 comments on commit ab37128

Please sign in to comment.