From: Stefan Weil Date: Tue, 22 May 2012 21:23:32 +0000 (+0200) Subject: virtio: Fix compiler warning for non Linux hosts X-Git-Tag: v1.1.1~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7d440f20bda8658fe16bdfe9c41c689764c50248;p=users%2Fdwmw2%2Fqemu.git virtio: Fix compiler warning for non Linux hosts The local variables ret, i are only used if __linux__ is defined. Signed-off-by: Stefan Weil Signed-off-by: Kevin Wolf (cherry picked from commit 47ce9ef7f89032c4079bf5132a12d1bfd4d5bca5) Signed-off-by: Michael Roth --- diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index 4f5745033e..fe0774617b 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -147,9 +147,11 @@ static VirtIOBlockReq *virtio_blk_get_request(VirtIOBlock *s) static void virtio_blk_handle_scsi(VirtIOBlockReq *req) { +#ifdef __linux__ int ret; - int status = VIRTIO_BLK_S_OK; int i; +#endif + int status = VIRTIO_BLK_S_OK; /* * We require at least one output segment each for the virtio_blk_outhdr