]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/i386/kvmvapic: Remove dead code in patch_hypercalls()
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 9 Jan 2017 17:05:21 +0000 (17:05 +0000)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 24 Jan 2017 20:26:53 +0000 (23:26 +0300)
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 <peter.maydell@linaro.org>
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/i386/kvmvapic.c

index 2f767b620e282fbab9bfaf354f8b360cab3ea25a..702e281dc8f5647785766613da0166557a311017 100644 (file)
@@ -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;
 }