[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Patch for 'set but not used' variable in atapi.c
From: |
Yaniv Kaul |
Subject: |
[Qemu-devel] Patch for 'set but not used' variable in atapi.c |
Date: |
Wed, 27 Apr 2011 21:37:03 +0300 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110422 Fedora/3.1.9-7.fc15 Thunderbird/3.1.9 |
I'm pretty sure it's not in the right format, without signed-off, etc,
but perhaps it could be put into the trivial or block branches.
Fixes the following error (with gcc 4.6, default settings):
/home/ykaul/qemu/hw/ide/atapi.c: In function ‘ide_atapi_cmd’:
/home/ykaul/qemu/hw/ide/atapi.c:1083:20: error: variable ‘packet’ set
but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
Regretfully, there are more to fix, with or without KVM support. The tcg
one puzzles me a bit:
CC x86_64-softmmu/tcg/tcg.o
/home/ykaul/qemu/tcg/tcg.c: In function ‘tcg_gen_callN’:
/home/ykaul/qemu/tcg/tcg.c:589:9: error: variable ‘call_type’ set but
not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
Removing the variable and the set line actually works, although I see
the variables used few lines later. Some #ifdef I'm not seeing, probably.
Thanks,
Y.
Signed-off-by: Yaniv Kaul<address@hidden>
---
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 690a0ab..334d6fd 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -1080,10 +1080,12 @@ static const struct {
void ide_atapi_cmd(IDEState *s)
{
- const uint8_t *packet;
uint8_t *buf;
+#ifdef DEBUG_IDE_ATAPI
+ const uint8_t *packet;
packet = s->io_buffer;
+#endif
buf = s->io_buffer;
#ifdef DEBUG_IDE_ATAPI
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] Patch for 'set but not used' variable in atapi.c,
Yaniv Kaul <=