[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/30] hw/sh4: Coding style: Remove unnecessary casts
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 05/30] hw/sh4: Coding style: Remove unnecessary casts |
Date: |
Sat, 30 Oct 2021 19:05:50 +0200 |
From: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Message-Id:
<6cb1bcf24572ad8465c20b64fec81157f34bcbe9.1635541329.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/timer/sh_timer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c
index 68c109ecfd0..02eb865908d 100644
--- a/hw/timer/sh_timer.c
+++ b/hw/timer/sh_timer.c
@@ -233,7 +233,7 @@ static void *sh_timer_init(uint32_t freq, int feat,
qemu_irq irq)
{
sh_timer_state *s;
- s = (sh_timer_state *)g_malloc0(sizeof(sh_timer_state));
+ s = g_malloc0(sizeof(*s));
s->freq = freq;
s->feat = feat;
s->tcor = 0xffffffff;
@@ -358,7 +358,7 @@ void tmu012_init(MemoryRegion *sysmem, hwaddr base,
tmu012_state *s;
int timer_feat = (feat & TMU012_FEAT_EXTCLK) ? TIMER_FEAT_EXTCLK : 0;
- s = (tmu012_state *)g_malloc0(sizeof(tmu012_state));
+ s = g_malloc0(sizeof(*s));
s->feat = feat;
s->timer[0] = sh_timer_init(freq, timer_feat, ch0_irq);
s->timer[1] = sh_timer_init(freq, timer_feat, ch1_irq);
--
2.31.1
- [PULL 00/30] Renesas SH-4 patches for 2021-10-30, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 01/30] hw/sh4: Coding style: Remove tabs, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 02/30] hw/sh4: Coding style: Fix multi-line comments, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 03/30] hw/sh4: Coding style: White space fixes, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 04/30] hw/sh4: Coding style: Add missing braces, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 05/30] hw/sh4: Coding style: Remove unnecessary casts,
Philippe Mathieu-Daudé <=
- [PULL 06/30] hw/sh4: Fix typos in a comment, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 07/30] hw/sh4: Change debug printfs to traces, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 08/30] hw/sh4/r2d: Use error_report instead of fprintf to stderr, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 09/30] hw/char/sh_serial: Do not abort on invalid access, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 10/30] hw/char/sh_serial: Rename type sh_serial_state to SHSerialState, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 11/30] hw/char/sh_serial: Embed QEMUTimer in state struct, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 12/30] hw/char/sh_serial: Split off sh_serial_reset() from sh_serial_init(), Philippe Mathieu-Daudé, 2021/10/30
- [PULL 13/30] hw/char/sh_serial: QOM-ify, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 14/30] hw/char/sh_serial: Add device id to trace output, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 15/30] hw/intc/sh_intc: Use existing macro instead of local one, Philippe Mathieu-Daudé, 2021/10/30