From: Markus Armbruster <armbru@redhat.com>
To: Raghavendra D Prabhu <raghu.prabhu13@gmail.com>
Cc: qemu-devel@nongnu.org, Raghavendra D Prabhu <rprabhu@wnohang.net>,
kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH 3/3] Avoid Wunsed-but-set warnings (or errors in case of Werror)
Date: Tue, 05 Jul 2011 08:15:46 +0200 [thread overview]
Message-ID: <m3oc19b6ct.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <2cb2082c25eadc24d1e22ebbd4293e3e6b53c832.1309816302.git.rprabhu@wnohang.net> (Raghavendra D. Prabhu's message of "Tue, 5 Jul 2011 03:30:02 +0530")
Typo in subject: "unsed". The warning is spelled
"unused-but-set-variable", the option "-Wunused-but-set-variable".
Raghavendra D Prabhu <raghu.prabhu13@gmail.com> writes:
> In a few cases, variable attributed 'unused' has been added, in other cases
> unused variable has been either removed or commented out.
>
> Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
> ---
> hw/device-assignment.c | 6 +++---
> simpletrace.c | 2 +-
> xen-mapcache.c | 7 ++-----
> 3 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/hw/device-assignment.c b/hw/device-assignment.c
> index 36ad6b0..19a59b4 100644
> --- a/hw/device-assignment.c
> +++ b/hw/device-assignment.c
> @@ -1654,7 +1654,7 @@ static void reset_assigned_device(DeviceState *dev)
> AssignedDevice *adev = DO_UPCAST(AssignedDevice, dev, pci_dev);
> char reset_file[64];
> const char reset[] = "1";
> - int fd, ret;
> + int fd, __attribute__((unused)) ret;
>
> snprintf(reset_file, sizeof(reset_file),
> "/sys/bus/pci/devices/%04x:%02x:%02x.%01x/reset",
What about (void)write() and do away with ret?
> @@ -1682,7 +1682,7 @@ static void reset_assigned_device(DeviceState *dev)
> static int assigned_initfn(struct PCIDevice *pci_dev)
> {
> AssignedDevice *dev = DO_UPCAST(AssignedDevice, dev, pci_dev);
> - uint8_t e_device, e_intx;
> + uint8_t e_intx;
> int r;
>
> if (!kvm_enabled()) {
> @@ -1709,7 +1709,7 @@ static int assigned_initfn(struct PCIDevice *pci_dev)
> goto out;
>
> /* handle interrupt routing */
> - e_device = (dev->dev.devfn >> 3) & 0x1f;
> + /*e_device = (dev->dev.devfn >> 3) & 0x1f;*/
> e_intx = dev->dev.config[0x3d] - 1;
> dev->intpin = e_intx;
> dev->run = 0;
> diff --git a/simpletrace.c b/simpletrace.c
> index f1dbb5e..2ce9cff 100644
> --- a/simpletrace.c
> +++ b/simpletrace.c
> @@ -119,7 +119,7 @@ static void *writeout_thread(void *opaque)
> TraceRecord record;
> unsigned int writeout_idx = 0;
> unsigned int num_available, idx;
> - size_t unused;
> + size_t __attribute__((unused)) unused;
>
> for (;;) {
> wait_for_trace_records_available();
Same here.
[...]
next prev parent reply other threads:[~2011-07-05 6:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-04 21:59 [PATCH 0/3] Build fixes Raghavendra D Prabhu
2011-07-04 22:00 ` [PATCH 1/3] Avoid the use of deprecated gnutls gnutls_*_set_priority functions Raghavendra D Prabhu
2011-08-22 8:26 ` Stefan Hajnoczi
2011-08-22 10:13 ` Gerd Hoffmann
2011-08-25 10:54 ` Stefan Hajnoczi
2011-08-25 11:02 ` Daniel P. Berrange
2011-07-04 22:00 ` [PATCH 2/3] Add fno-strict-overflow Raghavendra D Prabhu
2011-07-04 22:38 ` [Qemu-devel] " Peter Maydell
2011-07-05 5:41 ` Stefan Hajnoczi
2011-07-05 9:34 ` Stefan Hajnoczi
2011-07-05 15:36 ` Raghavendra D Prabhu
2011-07-05 20:30 ` Stefan Hajnoczi
2011-07-07 21:51 ` Raghavendra D Prabhu
2011-07-04 22:00 ` [PATCH 3/3] Avoid Wunsed-but-set warnings (or errors in case of Werror) Raghavendra D Prabhu
2011-07-05 6:15 ` Markus Armbruster [this message]
2011-07-05 7:02 ` [Qemu-devel] " Peter Maydell
2011-07-05 7:49 ` Markus Armbruster
2011-07-05 8:05 ` Paolo Bonzini
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=m3oc19b6ct.fsf@blackfin.pond.sub.org \
--to=armbru@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=raghu.prabhu13@gmail.com \
--cc=rprabhu@wnohang.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