[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/5] hw/sh4: Coding style: Remove unnecessary casts
From: |
BALATON Zoltan |
Subject: |
[PATCH 5/5] hw/sh4: Coding style: Remove unnecessary casts |
Date: |
Sun, 24 Oct 2021 02:40:53 +0200 |
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
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 68c109ecfd..02eb865908 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.21.4
- [PATCH 0/5] hw/sh4: Codeing style fixes, BALATON Zoltan, 2021/10/23
- [PATCH 2/5] hw/sh4: Coding style: Fix multi-line comments, BALATON Zoltan, 2021/10/23
- [PATCH 4/5] hw/sh4: Coding style: Add missing braces, BALATON Zoltan, 2021/10/23
- [PATCH 1/5] hw/sh4: Coding style: Remove tabs, BALATON Zoltan, 2021/10/23
- [PATCH 3/5] hw/sh4: Coding style: White space fixes, BALATON Zoltan, 2021/10/23
- [PATCH 5/5] hw/sh4: Coding style: Remove unnecessary casts,
BALATON Zoltan <=
- Re: [PATCH 0/5] hw/sh4: Codeing style fixes, Philippe Mathieu-Daudé, 2021/10/24
- Re: [PATCH 0/5] hw/sh4: Codeing style fixes, Yoshinori Sato, 2021/10/25