From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NVCcq-0001J2-TM for qemu-devel@nongnu.org; Wed, 13 Jan 2010 18:27:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NVCcl-0001Iq-Ii for qemu-devel@nongnu.org; Wed, 13 Jan 2010 18:27:43 -0500 Received: from [199.232.76.173] (port=46290 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NVCcl-0001In-DR for qemu-devel@nongnu.org; Wed, 13 Jan 2010 18:27:39 -0500 Received: from mail-qy0-f194.google.com ([209.85.221.194]:34668) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NVCcl-0001J3-4J for qemu-devel@nongnu.org; Wed, 13 Jan 2010 18:27:39 -0500 Received: by mail-qy0-f194.google.com with SMTP id 32so3454591qyk.4 for ; Wed, 13 Jan 2010 15:27:39 -0800 (PST) Message-ID: <4B4E56E7.4050102@codemonkey.ws> Date: Wed, 13 Jan 2010 17:27:35 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] virtio-blk: remove dead variable in virtio_blk_handle_scsi References: <20100113123032.GA5728@lst.de> In-Reply-To: <20100113123032.GA5728@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org On 01/13/2010 06:30 AM, Christoph Hellwig wrote: > As pointed out by clang size is only ever written to, but never actually > used. > > Signed-off-by: Christoph Hellwig > Applied. Thanks. Regards, Anthony Liguori > Index: qemu/hw/virtio-blk.c > =================================================================== > --- qemu.orig/hw/virtio-blk.c 2010-01-13 13:25:00.911004071 +0100 > +++ qemu/hw/virtio-blk.c 2010-01-13 13:25:17.014006323 +0100 > @@ -165,7 +165,7 @@ static VirtIOBlockReq *virtio_blk_get_re > static void virtio_blk_handle_scsi(VirtIOBlockReq *req) > { > struct sg_io_hdr hdr; > - int ret, size = 0; > + int ret; > int status; > int i; > > @@ -194,7 +194,6 @@ static void virtio_blk_handle_scsi(VirtI > * before the regular inhdr. > */ > req->scsi = (void *)req->elem.in_sg[req->elem.in_num - 2].iov_base; > - size = sizeof(*req->in) + sizeof(*req->scsi); > > memset(&hdr, 0, sizeof(struct sg_io_hdr)); > hdr.interface_id = 'S'; > @@ -226,7 +225,6 @@ static void virtio_blk_handle_scsi(VirtI > hdr.dxfer_len += req->elem.in_sg[i].iov_len; > > hdr.dxferp = req->elem.in_sg; > - size += hdr.dxfer_len; > } else { > /* > * Some SCSI commands don't actually transfer any data. > @@ -236,7 +234,6 @@ static void virtio_blk_handle_scsi(VirtI > > hdr.sbp = req->elem.in_sg[req->elem.in_num - 3].iov_base; > hdr.mx_sb_len = req->elem.in_sg[req->elem.in_num - 3].iov_len; > - size += hdr.mx_sb_len; > > ret = bdrv_ioctl(req->dev->bs, SG_IO,&hdr); > if (ret) { > > > >