From d83c951cce14dd3c7600c386d3791c4993744622 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 13 Aug 2012 13:05:44 +0200 Subject: scsi: fix warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Blue Swirl --- hw/scsi-bus.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index b8a857d145..4981a02436 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -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: -- cgit v1.2.1