From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Cc: patches@linaro.org, "Michael S. Tsirkin" <mst@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>,
Eduardo Habkost <ehabkost@redhat.com>,
Jan Kiszka <jan.kiszka@siemens.com>
Subject: [Qemu-devel] [PATCH] hw/i386/kvmvapic: Remove dead code in patch_hypercalls()
Date: Mon, 9 Jan 2017 17:05:21 +0000 [thread overview]
Message-ID: <1483981521-6789-1-git-send-email-peter.maydell@linaro.org> (raw)
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>
---
Perhaps this was unintentionally retained debug code?
It's not clear to me why the ROM should be required to
have exactly zero or two hypercalls in it. In any case
we've been fine without checking the patch count for
five years :-)
CC'd Jan as original code author just in case he remembers.
---
hw/i386/kvmvapic.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c
index b30d1b9..418dba1 100644
--- a/hw/i386/kvmvapic.c
+++ b/hw/i386/kvmvapic.c
@@ -534,7 +534,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;
@@ -565,11 +564,6 @@ static int patch_hypercalls(VAPICROMState *s)
}
g_free(rom);
-
- if (patches != 0 && patches != 2) {
- return -1;
- }
-
return 0;
}
--
2.7.4
next reply other threads:[~2017-01-09 17:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-09 17:05 Peter Maydell [this message]
2017-01-09 17:29 ` [Qemu-devel] [PATCH] hw/i386/kvmvapic: Remove dead code in patch_hypercalls() Jan Kiszka
2017-01-12 10:59 ` Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1483981521-6789-1-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=ehabkost@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=mst@redhat.com \
--cc=patches@linaro.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).