diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/mips_fulong2e.c | 3 | ||||
-rw-r--r-- | hw/mips_malta.c | 3 | ||||
-rw-r--r-- | hw/mipsnet.c | 2 | ||||
-rw-r--r-- | hw/pci.c | 2 | ||||
-rw-r--r-- | hw/rc4030.c | 5 | ||||
-rw-r--r-- | hw/sysbus.c | 3 | ||||
-rw-r--r-- | hw/sysbus.h | 5 | ||||
-rw-r--r-- | hw/virtex_ml507.c | 3 | ||||
-rw-r--r-- | hw/virtio-9p.c | 10 | ||||
-rw-r--r-- | hw/xen_backend.h | 2 |
10 files changed, 24 insertions, 14 deletions
diff --git a/hw/mips_fulong2e.c b/hw/mips_fulong2e.c index 61ca9c4..df80ef6 100644 --- a/hw/mips_fulong2e.c +++ b/hw/mips_fulong2e.c @@ -76,7 +76,8 @@ static struct _loaderparams { const char *initrd_filename; } loaderparams; -static void prom_set(uint32_t* prom_buf, int index, const char *string, ...) +static void GCC_FMT_ATTR(3, 4) prom_set(uint32_t* prom_buf, int index, + const char *string, ...) { va_list ap; int32_t table_addr; diff --git a/hw/mips_malta.c b/hw/mips_malta.c index 1cb7880..09690894 100644 --- a/hw/mips_malta.c +++ b/hw/mips_malta.c @@ -654,7 +654,8 @@ static void write_bootloader (CPUState *env, uint8_t *base, } -static void prom_set(uint32_t* prom_buf, int index, const char *string, ...) +static void GCC_FMT_ATTR(3, 4) prom_set(uint32_t* prom_buf, int index, + const char *string, ...) { va_list ap; int32_t table_addr; diff --git a/hw/mipsnet.c b/hw/mipsnet.c index a95b3ce..c5e54ff 100644 --- a/hw/mipsnet.c +++ b/hw/mipsnet.c @@ -81,7 +81,7 @@ static ssize_t mipsnet_receive(VLANClientState *nc, const uint8_t *buf, size_t s MIPSnetState *s = DO_UPCAST(NICState, nc, nc)->opaque; #ifdef DEBUG_MIPSNET_RECEIVE - printf("mipsnet: receiving len=%d\n", size); + printf("mipsnet: receiving len=%zu\n", size); #endif if (!mipsnet_can_receive(nc)) return -1; @@ -604,7 +604,7 @@ static int pci_init_multifunction(PCIBus *bus, PCIDevice *dev) } /* - * multifuction bit is interpreted in two ways as follows. + * multifunction bit is interpreted in two ways as follows. * - all functions must set the bit to 1. * Example: Intel X53 * - function 0 must set the bit, but the rest function (> 0) diff --git a/hw/rc4030.c b/hw/rc4030.c index 2231373..abbc3eb 100644 --- a/hw/rc4030.c +++ b/hw/rc4030.c @@ -749,7 +749,10 @@ static void rc4030_do_dma(void *opaque, int n, uint8_t *buf, int len, int is_wri printf("rc4030 dma: Copying %d bytes %s host %p\n", len, is_write ? "from" : "to", buf); for (i = 0; i < len; i += 16) { - int n = min(16, len - i); + int n = 16; + if (n > len - i) { + n = len - i; + } for (j = 0; j < n; j++) printf("%02x ", buf[i + j]); while (j++ < 16) diff --git a/hw/sysbus.c b/hw/sysbus.c index 1f7f138..d817721 100644 --- a/hw/sysbus.c +++ b/hw/sysbus.c @@ -82,7 +82,8 @@ void sysbus_pass_irq(SysBusDevice *dev, SysBusDevice *target) } } -void sysbus_init_mmio(SysBusDevice *dev, target_phys_addr_t size, int iofunc) +void sysbus_init_mmio(SysBusDevice *dev, target_phys_addr_t size, + ram_addr_t iofunc) { int n; diff --git a/hw/sysbus.h b/hw/sysbus.h index 1a8f289..5980901 100644 --- a/hw/sysbus.h +++ b/hw/sysbus.h @@ -21,7 +21,7 @@ struct SysBusDevice { target_phys_addr_t addr; target_phys_addr_t size; mmio_mapfunc cb; - int iofunc; + ram_addr_t iofunc; } mmio[QDEV_MAX_MMIO]; }; @@ -39,7 +39,8 @@ typedef struct { void sysbus_register_dev(const char *name, size_t size, sysbus_initfn init); void sysbus_register_withprop(SysBusDeviceInfo *info); void *sysbus_new(void); -void sysbus_init_mmio(SysBusDevice *dev, target_phys_addr_t size, int iofunc); +void sysbus_init_mmio(SysBusDevice *dev, target_phys_addr_t size, + ram_addr_t iofunc); void sysbus_init_mmio_cb(SysBusDevice *dev, target_phys_addr_t size, mmio_mapfunc cb); void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p); diff --git a/hw/virtex_ml507.c b/hw/virtex_ml507.c index 2af3b81..c5bbeda 100644 --- a/hw/virtex_ml507.c +++ b/hw/virtex_ml507.c @@ -157,8 +157,9 @@ static int xilinx_load_device_tree(target_phys_addr_t addr, fdt = load_device_tree(path, &fdt_size); qemu_free(path); } - if (!fdt) + if (!fdt) { return 0; + } } r = qemu_devtree_setprop_string(fdt, "/chosen", "bootargs", kernel_cmdline); diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c index 32fa3bc..3b2d49c 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -333,7 +333,8 @@ static int number_to_string(void *arg, char type) return ret; } -static int v9fs_string_alloc_printf(char **strp, const char *fmt, va_list ap) +static int GCC_FMT_ATTR(2, 0) +v9fs_string_alloc_printf(char **strp, const char *fmt, va_list ap) { va_list ap2; char *iter = (char *)fmt; @@ -387,7 +388,8 @@ alloc_print: return vsprintf(*strp, fmt, ap); } -static void v9fs_string_sprintf(V9fsString *str, const char *fmt, ...) +static void GCC_FMT_ATTR(2, 3) +v9fs_string_sprintf(V9fsString *str, const char *fmt, ...) { va_list ap; int err; @@ -1034,8 +1036,8 @@ static int stat_to_v9stat(V9fsState *s, V9fsString *name, S_ISCHR(stbuf->st_mode) ? 'c' : 'b', major(stbuf->st_rdev), minor(stbuf->st_rdev)); } else if (S_ISDIR(stbuf->st_mode) || S_ISREG(stbuf->st_mode)) { - v9fs_string_sprintf(&v9stat->extension, "%s %u", - "HARDLINKCOUNT", stbuf->st_nlink); + v9fs_string_sprintf(&v9stat->extension, "%s %lu", + "HARDLINKCOUNT", (unsigned long)stbuf->st_nlink); } str = strrchr(name->data, '/'); diff --git a/hw/xen_backend.h b/hw/xen_backend.h index 292126d..1b428e3 100644 --- a/hw/xen_backend.h +++ b/hw/xen_backend.h @@ -84,7 +84,7 @@ int xen_be_bind_evtchn(struct XenDevice *xendev); void xen_be_unbind_evtchn(struct XenDevice *xendev); int xen_be_send_notify(struct XenDevice *xendev); void xen_be_printf(struct XenDevice *xendev, int msg_level, const char *fmt, ...) - __attribute__ ((format(printf, 3, 4))); + GCC_FMT_ATTR(3, 4); /* actual backend drivers */ extern struct XenDevOps xen_console_ops; /* xen_console.c */ |