From patchwork Wed Jan 13 12:30:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 42815 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E5582B7C9E for ; Wed, 13 Jan 2010 23:36:10 +1100 (EST) Received: from localhost ([127.0.0.1]:34513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NV2P2-0006i9-8f for incoming@patchwork.ozlabs.org; Wed, 13 Jan 2010 07:32:48 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NV2N2-0006Pe-Es for qemu-devel@nongnu.org; Wed, 13 Jan 2010 07:30:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NV2Mx-0006Mx-TQ for qemu-devel@nongnu.org; Wed, 13 Jan 2010 07:30:43 -0500 Received: from [199.232.76.173] (port=35200 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NV2Mx-0006Mt-Ks for qemu-devel@nongnu.org; Wed, 13 Jan 2010 07:30:39 -0500 Received: from verein.lst.de ([213.95.11.210]:60309) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1NV2Mx-0001Qk-6C for qemu-devel@nongnu.org; Wed, 13 Jan 2010 07:30:39 -0500 Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id o0DCUWWY005740 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 13 Jan 2010 13:30:32 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-7.2) id o0DCUWX0005739 for qemu-devel@nongnu.org; Wed, 13 Jan 2010 13:30:32 +0100 Date: Wed, 13 Jan 2010 13:30:32 +0100 From: Christoph Hellwig To: qemu-devel@nongnu.org Message-ID: <20100113123032.GA5728@lst.de> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam-Score: 0 () X-Scanned-By: MIMEDefang 2.39 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH] virtio-blk: remove dead variable in virtio_blk_handle_scsi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org As pointed out by clang size is only ever written to, but never actually used. Signed-off-by: Christoph Hellwig 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) {