Skip to contentSkip to conversation

suppress a couple of spurious warnings in scsi-generic.c

PATCH Applied Ian Jackson 2 participants 2 messages Aug 28, 2008 – Sep 2, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 suppress a couple of spurious warnings in scsi-generic.c

This patch fixes two spurious `may be used uninitialised' warnings when compiling with some compilers.

(Manually cherry-picked from qemu-xen master
c9dba66abe8f4c4df28f3b32befe49da1b749a48)

hw/scsi-generic.c +2 -2
index 60084cf..3973c25 100644
@@ -478,8 +478,8 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
                                  uint8_t *cmd, int lun)
 {
     SCSIDeviceState *s = d->state;
-    uint32_t len;
-    int cmdlen;
+    uint32_t len=0;
+    int cmdlen=0;
     SCSIRequest *r;
     int ret;
 
#1 lore raw
Quoted 8 lines · Ian Jackson

This patch fixes two spurious `may be used uninitialised' warnings when compiling with some compilers.

(Manually cherry-picked from qemu-xen master
c9dba66abe8f4c4df28f3b32befe49da1b749a48)

Applied, thanks.

Quoted 18 lines
hw/scsi-generic.c +2 -2
index 60084cf..3973c25 100644
@@ -478,8 +478,8 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
                                  uint8_t *cmd, int lun)
 {
     SCSIDeviceState *s = d->state;
-    uint32_t len;
-    int cmdlen;
+    uint32_t len=0;
+    int cmdlen=0;
     SCSIRequest *r;
     int ret;
 
Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net