From: Stefan Weil <weil@mail.berlios.de>
To: QEMU Developers <qemu-devel@nongnu.org>
Cc: Riku Voipio <riku.voipio@iki.fi>
Subject: [Qemu-devel] [PATCH] linux-user: Set uninitialized local variable and disable unused code
Date: Sat, 7 May 2011 22:44:08 +0200 [thread overview]
Message-ID: <1304801048-26036-1-git-send-email-weil@mail.berlios.de> (raw)
cppcheck report:
linux-user/signal.c:2057: error: Uninitialized variable: err
cppcheck is correct. Setting err = 0 is a workaround to avoid
random results and the cppcheck warning.
Function restore_fpu_state is currently unused, so I disabled the code.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
linux-user/signal.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index ce033e9..4bda475 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -2027,6 +2027,8 @@ sigsegv:
unlock_user(sf, sf_addr, sizeof(struct target_signal_frame));
force_sig(TARGET_SIGSEGV);
}
+
+#if 0 /* TODO: function is unused */
static inline int
restore_fpu_state(CPUState *env, qemu_siginfo_fpu_t *fpu)
{
@@ -2053,6 +2055,8 @@ restore_fpu_state(CPUState *env, qemu_siginfo_fpu_t *fpu)
/* XXX: incorrect */
err = __copy_from_user(&env->fpr[0], &fpu->si_float_regs[0],
(sizeof(unsigned long) * 32));
+#else
+ err = 0;
#endif
err |= __get_user(env->fsr, &fpu->si_fsr);
#if 0
@@ -2065,7 +2069,7 @@ restore_fpu_state(CPUState *env, qemu_siginfo_fpu_t *fpu)
#endif
return err;
}
-
+#endif
static void setup_rt_frame(int sig, struct target_sigaction *ka,
target_siginfo_t *info,
--
1.7.2.5
next reply other threads:[~2011-05-07 20:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-07 20:44 Stefan Weil [this message]
2011-05-07 21:50 ` [Qemu-devel] [PATCH] linux-user: Set uninitialized local variable and disable unused code Peter Maydell
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=1304801048-26036-1-git-send-email-weil@mail.berlios.de \
--to=weil@mail.berlios.de \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/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).