aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/core/Makefile.objs2
-rw-r--r--hw/core/register.c8
-rw-r--r--hw/scsi/lsi53c895a.c10
-rw-r--r--hw/sparc64/sun4u.c2
-rw-r--r--hw/timer/altera_timer.c2
-rw-r--r--hw/xtensa/sim.c10
6 files changed, 16 insertions, 18 deletions
diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs
index 91450b2eab..f8d7a4aaed 100644
--- a/hw/core/Makefile.objs
+++ b/hw/core/Makefile.objs
@@ -5,7 +5,7 @@ common-obj-y += fw-path-provider.o
# irq.o needed for qdev GPIO handling:
common-obj-y += irq.o
common-obj-y += hotplug.o
-obj-y += nmi.o
+common-obj-y += nmi.o
common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
common-obj-$(CONFIG_XILINX_AXI) += stream.o
diff --git a/hw/core/register.c b/hw/core/register.c
index da38ef3a54..900294b9c4 100644
--- a/hw/core/register.c
+++ b/hw/core/register.c
@@ -195,8 +195,8 @@ void register_write_memory(void *opaque, hwaddr addr,
}
if (!reg) {
- qemu_log_mask(LOG_GUEST_ERROR, "Write to unimplemented register at " \
- "address: %#" PRIx64 "\n", addr);
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: write to unimplemented register " \
+ "at address: %#" PRIx64 "\n", reg_array->prefix, addr);
return;
}
@@ -224,8 +224,8 @@ uint64_t register_read_memory(void *opaque, hwaddr addr,
}
if (!reg) {
- qemu_log_mask(LOG_GUEST_ERROR, "Read to unimplemented register at " \
- "address: %#" PRIx64 "\n", addr);
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: read to unimplemented register " \
+ "at address: %#" PRIx64 "\n", reg_array->prefix, addr);
return 0;
}
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 595c26017a..3e56ab267c 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -408,27 +408,25 @@ static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val);
static void lsi_execute_script(LSIState *s);
static void lsi_reselect(LSIState *s, lsi_request *p);
-static inline int lsi_mem_read(LSIState *s, dma_addr_t addr,
+static inline void lsi_mem_read(LSIState *s, dma_addr_t addr,
void *buf, dma_addr_t len)
{
if (s->dmode & LSI_DMODE_SIOM) {
address_space_read(&s->pci_io_as, addr, MEMTXATTRS_UNSPECIFIED,
buf, len);
- return 0;
} else {
- return pci_dma_read(PCI_DEVICE(s), addr, buf, len);
+ pci_dma_read(PCI_DEVICE(s), addr, buf, len);
}
}
-static inline int lsi_mem_write(LSIState *s, dma_addr_t addr,
+static inline void lsi_mem_write(LSIState *s, dma_addr_t addr,
const void *buf, dma_addr_t len)
{
if (s->dmode & LSI_DMODE_DIOM) {
address_space_write(&s->pci_io_as, addr, MEMTXATTRS_UNSPECIFIED,
buf, len);
- return 0;
} else {
- return pci_dma_write(PCI_DEVICE(s), addr, buf, len);
+ pci_dma_write(PCI_DEVICE(s), addr, buf, len);
}
}
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 18b8f8bcba..69f565db25 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -214,7 +214,7 @@ static void isa_irq_handler(void *opaque, int n, int level)
qemu_irq *irqs = opaque;
int ivec;
- assert(n < 16);
+ assert(n < ARRAY_SIZE(isa_irq_to_ivec));
ivec = isa_irq_to_ivec[n];
EBUS_DPRINTF("Set ISA IRQ %d level %d -> ivec 0x%x\n", n, level, ivec);
if (ivec) {
diff --git a/hw/timer/altera_timer.c b/hw/timer/altera_timer.c
index 6d4862661d..c9a0fc5dca 100644
--- a/hw/timer/altera_timer.c
+++ b/hw/timer/altera_timer.c
@@ -204,7 +204,7 @@ static void altera_timer_reset(DeviceState *dev)
ptimer_stop(t->ptimer);
ptimer_set_limit(t->ptimer, 0xffffffff, 1);
- memset(t->regs, 0, ARRAY_SIZE(t->regs));
+ memset(t->regs, 0, sizeof(t->regs));
}
static Property altera_timer_properties[] = {
diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c
index d2d1d3a6fd..b27e28d802 100644
--- a/hw/xtensa/sim.c
+++ b/hw/xtensa/sim.c
@@ -41,21 +41,21 @@ static void xtensa_create_memory_regions(const XtensaMemory *memory,
const char *name)
{
unsigned i;
- char *num_name = malloc(strlen(name) + sizeof(i) * 3 + 1);
+ GString *num_name = g_string_new(NULL);
for (i = 0; i < memory->num; ++i) {
MemoryRegion *m;
- sprintf(num_name, "%s%u", name, i);
- m = g_malloc(sizeof(*m));
- memory_region_init_ram(m, NULL, num_name,
+ g_string_printf(num_name, "%s%u", name, i);
+ m = g_new(MemoryRegion, 1);
+ memory_region_init_ram(m, NULL, num_name->str,
memory->location[i].size,
&error_fatal);
vmstate_register_ram_global(m);
memory_region_add_subregion(get_system_memory(),
memory->location[i].addr, m);
}
- free(num_name);
+ g_string_free(num_name, true);
}
static uint64_t translate_phys_addr(void *opaque, uint64_t addr)