]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
scsi: fix warning
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 13 Aug 2012 11:05:44 +0000 (13:05 +0200)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 18 Aug 2012 08:50:09 +0000 (08:50 +0000)
hw/scsi-bus.c:758: warning: ‘xfer’ may be used uninitialized in this
function

Isn't true, but older gcc versions (for example 4.1 as shipped in rhel5)
are not clever enougth to figure, so sprinkle in a default: line to make
them happy.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/scsi-bus.c

index b8a857d145469bf78abd6bf092816affee27c159..4981a024365bc7646f60fea6f21225f9897303ed 100644 (file)
@@ -761,6 +761,7 @@ static int ata_passthrough_12_xfer_size(SCSIDevice *dev, uint8_t *buf)
     switch (length) {
     case 0:
     case 3: /* USB-specific.  */
+    default:
         xfer = 0;
         break;
     case 1:
@@ -784,6 +785,7 @@ static int ata_passthrough_16_xfer_size(SCSIDevice *dev, uint8_t *buf)
     switch (length) {
     case 0:
     case 3: /* USB-specific.  */
+    default:
         xfer = 0;
         break;
     case 1: