Re: [Qemu-devel] [PATCH 3/3] Avoid Wunsed-but-set warnings (or errors in case of Werror)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Typo in subject: "unsed".  The warning is spelled
"unused-but-set-variable", the option "-Wunused-but-set-variable".

Raghavendra D Prabhu <raghu.prabhu13@xxxxxxxxx> 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@xxxxxxxxxxx>
> ---
>  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.

[...]
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux