From patchwork Sat Apr 9 14:35:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 695991 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p39EawFQ014917 for ; Sat, 9 Apr 2011 14:36:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754333Ab1DIOgz (ORCPT ); Sat, 9 Apr 2011 10:36:55 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:34524 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753379Ab1DIOgr (ORCPT ); Sat, 9 Apr 2011 10:36:47 -0400 Received: by pzk9 with SMTP id 9so1542600pzk.19 for ; Sat, 09 Apr 2011 07:36:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=GnfcROSzQtMyMyj9Zvf2ydlMW8L5vB0qjkm2Kj+nfbU=; b=TpieNBveIrjJh4fOjGfLTlufqUa0y/0yS/X4pApZOzTIZmzCQqViBOpvFG4H/D8QCm ES0tbOmicf2E8Ho3X51Bp11Kf937gLZW3+Py7QxqEP+ZScuP80BLSLSRLpHXw/2uSQVt +tk1oBXDrdHciu8OYVSanJRrj4fmsXT/wwysM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=eh2nVqUE6zZcDHZzx3sBEk1Guce8R3WLYigFQ/TzepNODLghUEwTV3G8//tNzGfpsu 6wW640+8fTsT9q46+qZu9HhJqzOOkt1AxKUsiKbkqgBH/AvaeXMJWvz3CbfGaMqmkRfr KN3Xazi/nrydTi9y4xHh0FN03F97F169+eiWA= Received: by 10.143.169.7 with SMTP id w7mr2837668wfo.186.1302359806642; Sat, 09 Apr 2011 07:36:46 -0700 (PDT) Received: from localhost.localdomain ([202.112.128.131]) by mx.google.com with ESMTPS id o1sm5221068wfl.9.2011.04.09.07.36.42 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 09 Apr 2011 07:36:46 -0700 (PDT) From: Asias He To: Pekka Enberg , Cyrill Gorcunov , Ingo Molnar Cc: kvm@vger.kernel.org, Asias He Subject: [PATCH 2/2] kvm tools: Remove unnecessary goto label out_unlock Date: Sat, 9 Apr 2011 22:35:25 +0800 Message-Id: <1302359725-6457-2-git-send-email-asias.hejun@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1302359725-6457-1-git-send-email-asias.hejun@gmail.com> References: <1302359725-6457-1-git-send-email-asias.hejun@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 09 Apr 2011 14:36:59 +0000 (UTC) There is only one switch in virtio_blk_pci_io_out and virtio_blk_pci_io_in. No need to use goto, just use break is fine. Signed-off-by: Asias He --- tools/kvm/virtio-blk.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/kvm/virtio-blk.c b/tools/kvm/virtio-blk.c index 79f27c1..06e58bc 100644 --- a/tools/kvm/virtio-blk.c +++ b/tools/kvm/virtio-blk.c @@ -81,7 +81,7 @@ static bool virtio_blk_pci_io_in(struct kvm *self, uint16_t port, void *data, in break; case VIRTIO_PCI_GUEST_FEATURES: ret = false; - goto out_unlock; + break; case VIRTIO_PCI_QUEUE_PFN: ioport__write32(data, blk_device.vqs[blk_device.queue_selector].pfn); break; @@ -91,7 +91,7 @@ static bool virtio_blk_pci_io_in(struct kvm *self, uint16_t port, void *data, in case VIRTIO_PCI_QUEUE_SEL: case VIRTIO_PCI_QUEUE_NOTIFY: ret = false; - goto out_unlock; + break; case VIRTIO_PCI_STATUS: ioport__write8(data, blk_device.status); break; @@ -104,10 +104,8 @@ static bool virtio_blk_pci_io_in(struct kvm *self, uint16_t port, void *data, in break; default: ret = virtio_blk_pci_io_device_specific_in(data, offset, size, count); - goto out_unlock; }; -out_unlock: mutex_unlock(&blk_device.mutex); return ret; @@ -220,10 +218,8 @@ static bool virtio_blk_pci_io_out(struct kvm *self, uint16_t port, void *data, i break; default: ret = false; - goto out_unlock; }; -out_unlock: mutex_unlock(&blk_device.mutex); return ret;