提交 ab371287 编写于 作者: E Eric Moore 提交者: James Bottomley

[SCSI] mptctl : shutup uninitialized variable warnings

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: NEric Moore <Eric.Moore@lsi.com>
Signed-off-by: NSatyam Sharma <satyam@infradead.org>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 e1fc2b51
......@@ -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)) {
......@@ -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 ++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册