qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-trivial] [PULL 17/31] hw/i386/kvmvapic: Remove dead code in patch_


From: Michael Tokarev
Subject: [Qemu-trivial] [PULL 17/31] hw/i386/kvmvapic: Remove dead code in patch_hypercalls()
Date: Tue, 24 Jan 2017 12:39:21 +0300

From: Peter Maydell <address@hidden>

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 <address@hidden>
Acked-by: Jan Kiszka <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
 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;
 }
 
-- 
2.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]