From patchwork Tue Jan 24 09:39:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 718989 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v73sK1D90z9t25 for ; Tue, 24 Jan 2017 21:12:53 +1100 (AEDT) Received: from localhost ([::1]:47379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVy5q-0000ru-MG for incoming@patchwork.ozlabs.org; Tue, 24 Jan 2017 05:12:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVxem-00021H-JU for qemu-devel@nongnu.org; Tue, 24 Jan 2017 04:44:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVxei-0002cb-Ix for qemu-devel@nongnu.org; Tue, 24 Jan 2017 04:44:52 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:43729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVxei-0002cM-By; Tue, 24 Jan 2017 04:44:48 -0500 Received: from tsrv.tls.msk.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 115A842102; Tue, 24 Jan 2017 12:44:48 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.tls.msk.ru (Postfix) with SMTP id D7CA8572; Tue, 24 Jan 2017 12:39:43 +0300 (MSK) Received: (nullmailer pid 12643 invoked by uid 1000); Tue, 24 Jan 2017 09:39:41 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Tue, 24 Jan 2017 12:39:21 +0300 Message-Id: <7d628e2c05e0fd2da04f618ba41068a7c11b2a7d.1485250702.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 17/31] hw/i386/kvmvapic: Remove dead code in patch_hypercalls() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Peter Maydell , Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell The patch_hypercalls() function sets up a 'patches' variable and checks it at the end of the function, but never modifies it in the middle. Remove this dead code, which seems to have been present since the function was added in commit e5ad936b0fd7 in 2012. (Spotted by Coverity: CID 1005581.) Signed-off-by: Peter Maydell Acked-by: Jan Kiszka Signed-off-by: Michael Tokarev --- hw/i386/kvmvapic.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 2f767b6..702e281 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -535,7 +535,6 @@ static int patch_hypercalls(VAPICROMState *s) uint8_t alternates[2]; const uint8_t *pattern; const uint8_t *patch; - int patches = 0; off_t pos; uint8_t *rom; @@ -566,11 +565,6 @@ static int patch_hypercalls(VAPICROMState *s) } g_free(rom); - - if (patches != 0 && patches != 2) { - return -1; - } - return 0; }