* [patch 15/17] mpt fusion: shut up uninitialized variable warnings
@ 2007-10-02 21:38 akpm
2007-10-02 21:55 ` Matthew Wilcox
0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2007-10-02 21:38 UTC (permalink / raw)
To: James.Bottomley; +Cc: linux-scsi, akpm, satyam, eric.moore
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@infradead.org>
Acked-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch 15/17] mpt fusion: shut up uninitialized variable warnings
2007-10-02 21:38 [patch 15/17] mpt fusion: shut up uninitialized variable warnings akpm
@ 2007-10-02 21:55 ` Matthew Wilcox
0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2007-10-02 21:55 UTC (permalink / raw)
To: akpm; +Cc: James.Bottomley, linux-scsi, satyam, eric.moore
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 620 bytes --]
On Tue, Oct 02, 2007 at 02:38:11PM -0700, akpm@linux-foundation.org wrote:
> drivers/message/fusion/mptctl.c: In function ‘mptctl_mpt_command’:
Could we lose the UTF-8 garbage?
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-10-02 21:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-02 21:38 [patch 15/17] mpt fusion: shut up uninitialized variable warnings akpm
2007-10-02 21:55 ` Matthew Wilcox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox