diff options
author | Stefan Weil <sw@weilnetz.de> | 2013-04-12 20:53:58 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-04-19 11:36:33 +0200 |
commit | e1fe50dcb3c86e25ce482a7f67f2ac5405bced8a (patch) | |
tree | 065342a959517395be8db91c7dca32a496cdcb6f /hw/arm | |
parent | fd1ca7e0d5f76c6787428171355bcde49133c9c1 (diff) |
Remove unneeded type casts
cpu_physical_memory_read, cpu_physical_memory_write take any pointer
as 2nd argument without needing a type cast.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/arm')
-rw-r--r-- | hw/arm/armv7m.c | 12 | ||||
-rw-r--r-- | hw/arm/boot.c | 4 | ||||
-rw-r--r-- | hw/arm/musicpal.c | 8 | ||||
-rw-r--r-- | hw/arm/nseries.c | 4 | ||||
-rw-r--r-- | hw/arm/omap1.c | 12 |
5 files changed, 20 insertions, 20 deletions
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 2ae3576760..93422bc7be 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -56,7 +56,7 @@ static uint32_t bitband_readw(void *opaque, hwaddr offset) addr = bitband_addr(opaque, offset) & ~1; mask = (1 << ((offset >> 2) & 15)); mask = tswap16(mask); - cpu_physical_memory_read(addr, (uint8_t *)&v, 2); + cpu_physical_memory_read(addr, &v, 2); return (v & mask) != 0; } @@ -69,12 +69,12 @@ static void bitband_writew(void *opaque, hwaddr offset, addr = bitband_addr(opaque, offset) & ~1; mask = (1 << ((offset >> 2) & 15)); mask = tswap16(mask); - cpu_physical_memory_read(addr, (uint8_t *)&v, 2); + cpu_physical_memory_read(addr, &v, 2); if (value & 1) v |= mask; else v &= ~mask; - cpu_physical_memory_write(addr, (uint8_t *)&v, 2); + cpu_physical_memory_write(addr, &v, 2); } static uint32_t bitband_readl(void *opaque, hwaddr offset) @@ -85,7 +85,7 @@ static uint32_t bitband_readl(void *opaque, hwaddr offset) addr = bitband_addr(opaque, offset) & ~3; mask = (1 << ((offset >> 2) & 31)); mask = tswap32(mask); - cpu_physical_memory_read(addr, (uint8_t *)&v, 4); + cpu_physical_memory_read(addr, &v, 4); return (v & mask) != 0; } @@ -98,12 +98,12 @@ static void bitband_writel(void *opaque, hwaddr offset, addr = bitband_addr(opaque, offset) & ~3; mask = (1 << ((offset >> 2) & 31)); mask = tswap32(mask); - cpu_physical_memory_read(addr, (uint8_t *)&v, 4); + cpu_physical_memory_read(addr, &v, 4); if (value & 1) v |= mask; else v &= ~mask; - cpu_physical_memory_write(addr, (uint8_t *)&v, 4); + cpu_physical_memory_write(addr, &v, 4); } static const MemoryRegionOps bitband_ops = { diff --git a/hw/arm/boot.c b/hw/arm/boot.c index e9c09454ac..f451529fce 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -128,7 +128,7 @@ static void set_kernel_args(const struct arm_boot_info *info) int cmdline_size; cmdline_size = strlen(info->kernel_cmdline); - cpu_physical_memory_write(p + 8, (void *)info->kernel_cmdline, + cpu_physical_memory_write(p + 8, info->kernel_cmdline, cmdline_size + 1); cmdline_size = (cmdline_size >> 2) + 1; WRITE_WORD(p, cmdline_size + 2); @@ -219,7 +219,7 @@ static void set_kernel_args_old(const struct arm_boot_info *info) } s = info->kernel_cmdline; if (s) { - cpu_physical_memory_write(p, (void *)s, strlen(s) + 1); + cpu_physical_memory_write(p, s, strlen(s) + 1); } else { WRITE_WORD(p, 0); } diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 31586c652e..f33ba9a039 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -170,12 +170,12 @@ static void eth_rx_desc_put(uint32_t addr, mv88w8618_rx_desc *desc) cpu_to_le16s(&desc->buffer_size); cpu_to_le32s(&desc->buffer); cpu_to_le32s(&desc->next); - cpu_physical_memory_write(addr, (void *)desc, sizeof(*desc)); + cpu_physical_memory_write(addr, desc, sizeof(*desc)); } static void eth_rx_desc_get(uint32_t addr, mv88w8618_rx_desc *desc) { - cpu_physical_memory_read(addr, (void *)desc, sizeof(*desc)); + cpu_physical_memory_read(addr, desc, sizeof(*desc)); le32_to_cpus(&desc->cmdstat); le16_to_cpus(&desc->bytes); le16_to_cpus(&desc->buffer_size); @@ -229,12 +229,12 @@ static void eth_tx_desc_put(uint32_t addr, mv88w8618_tx_desc *desc) cpu_to_le16s(&desc->bytes); cpu_to_le32s(&desc->buffer); cpu_to_le32s(&desc->next); - cpu_physical_memory_write(addr, (void *)desc, sizeof(*desc)); + cpu_physical_memory_write(addr, desc, sizeof(*desc)); } static void eth_tx_desc_get(uint32_t addr, mv88w8618_tx_desc *desc) { - cpu_physical_memory_read(addr, (void *)desc, sizeof(*desc)); + cpu_physical_memory_read(addr, desc, sizeof(*desc)); le32_to_cpus(&desc->cmdstat); le16_to_cpus(&desc->res); le16_to_cpus(&desc->bytes); diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index 4976438ae6..f6c9dc09ef 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -970,7 +970,7 @@ static void n800_gpmc_init(struct n800_s *s) (4 << 0); /* BASEADDRESS */ cpu_physical_memory_write(0x6800a078, /* GPMC_CONFIG7_0 */ - (void *) &config7, sizeof(config7)); + &config7, sizeof(config7)); } /* Setup sequence done by the bootloader */ @@ -982,7 +982,7 @@ static void n8x0_boot_init(void *opaque) /* PRCM setup */ #define omap_writel(addr, val) \ buf = (val); \ - cpu_physical_memory_write(addr, (void *) &buf, sizeof(buf)) + cpu_physical_memory_write(addr, &buf, sizeof(buf)) omap_writel(0x48008060, 0x41); /* PRCM_CLKSRC_CTRL */ omap_writel(0x48008070, 1); /* PRCM_CLKOUT_CTRL */ diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index f59f0f291a..c06c642acc 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -31,7 +31,7 @@ uint32_t omap_badwidth_read8(void *opaque, hwaddr addr) uint8_t ret; OMAP_8B_REG(addr); - cpu_physical_memory_read(addr, (void *) &ret, 1); + cpu_physical_memory_read(addr, &ret, 1); return ret; } @@ -41,7 +41,7 @@ void omap_badwidth_write8(void *opaque, hwaddr addr, uint8_t val8 = value; OMAP_8B_REG(addr); - cpu_physical_memory_write(addr, (void *) &val8, 1); + cpu_physical_memory_write(addr, &val8, 1); } uint32_t omap_badwidth_read16(void *opaque, hwaddr addr) @@ -49,7 +49,7 @@ uint32_t omap_badwidth_read16(void *opaque, hwaddr addr) uint16_t ret; OMAP_16B_REG(addr); - cpu_physical_memory_read(addr, (void *) &ret, 2); + cpu_physical_memory_read(addr, &ret, 2); return ret; } @@ -59,7 +59,7 @@ void omap_badwidth_write16(void *opaque, hwaddr addr, uint16_t val16 = value; OMAP_16B_REG(addr); - cpu_physical_memory_write(addr, (void *) &val16, 2); + cpu_physical_memory_write(addr, &val16, 2); } uint32_t omap_badwidth_read32(void *opaque, hwaddr addr) @@ -67,7 +67,7 @@ uint32_t omap_badwidth_read32(void *opaque, hwaddr addr) uint32_t ret; OMAP_32B_REG(addr); - cpu_physical_memory_read(addr, (void *) &ret, 4); + cpu_physical_memory_read(addr, &ret, 4); return ret; } @@ -75,7 +75,7 @@ void omap_badwidth_write32(void *opaque, hwaddr addr, uint32_t value) { OMAP_32B_REG(addr); - cpu_physical_memory_write(addr, (void *) &value, 4); + cpu_physical_memory_write(addr, &value, 4); } /* MPU OS timers */ |