public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: fix the build warning
@ 2013-08-22  0:44 zwu.kernel
  2013-08-22  1:02 ` Joe Perches
  0 siblings, 1 reply; 14+ messages in thread
From: zwu.kernel @ 2013-08-22  0:44 UTC (permalink / raw)
  To: linux-scsi; +Cc: jbottomley, linux-kernel, Zhi Yong Wu

From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>

  Initialize csum variable to fix the build warning.

drivers/scsi/scsi_debug.c: In function ‘dif_verify’:
drivers/scsi/scsi_debug.c:1755:3: warning: ‘csum’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  LD      drivers/built-in.o
  CHK     include/generated/uapi/linux/version.h
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `relocs'.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
---
 drivers/scsi/scsi_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index cb4fefa..50d70c3 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -1733,7 +1733,7 @@ static int do_device_access(struct scsi_cmnd *scmd,
 
 static u16 dif_compute_csum(const void *buf, int len)
 {
-	u16 csum;
+	u16 csum = -1;
 
 	switch (scsi_debug_guard) {
 	case 1:
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-09-20 16:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-22  0:44 [PATCH] scsi: fix the build warning zwu.kernel
2013-08-22  1:02 ` Joe Perches
2013-08-22  1:05   ` Zhi Yong Wu
2013-08-22  1:17     ` Joe Perches
2013-08-22  1:25       ` Martin K. Petersen
2013-08-22  1:55         ` Joe Perches
2013-08-22  1:59           ` Zhi Yong Wu
2013-08-22  2:25             ` Joe Perches
2013-08-22 12:42         ` Akinobu Mita
2013-08-22 14:27           ` James Bottomley
2013-08-22 14:49             ` Akinobu Mita
2013-09-20  9:53               ` Paul Bolle
2013-09-20 14:32                 ` Akinobu Mita
2013-09-20 16:14                   ` Paul Bolle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox