Fix QEMU_WARN_UNUSED_RESULT
Since commit 747bbdf7
QEMU_WARN_UNUSED_RESULT is never defined as it is
conditional on a define from config-host.h which is included only later.
Include that file earlier to get the warnings back.
Reactivating it unfortunately leads to some warnings about unused qdev_init
results. These calls are changed to qdev_init_nofail to avoid build failures.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
0d2ed46af4
commit
beb6f0de7a
@ -1492,7 +1492,7 @@ static USBDevice *usb_net_init(const char *cmdline)
|
|||||||
|
|
||||||
dev = usb_create(NULL /* FIXME */, "usb-net");
|
dev = usb_create(NULL /* FIXME */, "usb-net");
|
||||||
qdev_set_nic_properties(&dev->qdev, &nd_table[idx]);
|
qdev_set_nic_properties(&dev->qdev, &nd_table[idx]);
|
||||||
qdev_init(&dev->qdev);
|
qdev_init_nofail(&dev->qdev);
|
||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -583,7 +583,7 @@ static USBDevice *usb_serial_init(const char *filename)
|
|||||||
qdev_prop_set_uint16(&dev->qdev, "vendorid", vendorid);
|
qdev_prop_set_uint16(&dev->qdev, "vendorid", vendorid);
|
||||||
if (productid)
|
if (productid)
|
||||||
qdev_prop_set_uint16(&dev->qdev, "productid", productid);
|
qdev_prop_set_uint16(&dev->qdev, "productid", productid);
|
||||||
qdev_init(&dev->qdev);
|
qdev_init_nofail(&dev->qdev);
|
||||||
|
|
||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
@ -599,7 +599,7 @@ static USBDevice *usb_braille_init(const char *unused)
|
|||||||
|
|
||||||
dev = usb_create(NULL /* FIXME */, "usb-braille");
|
dev = usb_create(NULL /* FIXME */, "usb-braille");
|
||||||
qdev_prop_set_chr(&dev->qdev, "chardev", cdrv);
|
qdev_prop_set_chr(&dev->qdev, "chardev", cdrv);
|
||||||
qdev_init(&dev->qdev);
|
qdev_init_nofail(&dev->qdev);
|
||||||
|
|
||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
#ifndef QEMU_COMMON_H
|
#ifndef QEMU_COMMON_H
|
||||||
#define QEMU_COMMON_H
|
#define QEMU_COMMON_H
|
||||||
|
|
||||||
|
#include "config-host.h"
|
||||||
|
|
||||||
#define QEMU_NORETURN __attribute__ ((__noreturn__))
|
#define QEMU_NORETURN __attribute__ ((__noreturn__))
|
||||||
#ifdef CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT
|
#ifdef CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT
|
||||||
#define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
#define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||||
@ -29,7 +31,6 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "config-host.h"
|
|
||||||
|
|
||||||
#ifndef O_LARGEFILE
|
#ifndef O_LARGEFILE
|
||||||
#define O_LARGEFILE 0
|
#define O_LARGEFILE 0
|
||||||
|
@ -1036,7 +1036,7 @@ USBDevice *usb_host_device_open(const char *devname)
|
|||||||
qdev_prop_set_uint32(&dev->qdev, "hostaddr", filter.addr);
|
qdev_prop_set_uint32(&dev->qdev, "hostaddr", filter.addr);
|
||||||
qdev_prop_set_uint32(&dev->qdev, "vendorid", filter.vendor_id);
|
qdev_prop_set_uint32(&dev->qdev, "vendorid", filter.vendor_id);
|
||||||
qdev_prop_set_uint32(&dev->qdev, "productid", filter.product_id);
|
qdev_prop_set_uint32(&dev->qdev, "productid", filter.product_id);
|
||||||
qdev_init(&dev->qdev);
|
qdev_init_nofail(&dev->qdev);
|
||||||
return dev;
|
return dev;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
Loading…
Reference in New Issue
Block a user