diff options
Diffstat (limited to 'hw/timer')
-rw-r--r-- | hw/timer/arm_timer.c | 2 | ||||
-rw-r--r-- | hw/timer/slavio_timer.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c index 15caff0e41..84cf2726bb 100644 --- a/hw/timer/arm_timer.c +++ b/hw/timer/arm_timer.c @@ -176,7 +176,7 @@ static arm_timer_state *arm_timer_init(uint32_t freq) { arm_timer_state *s; - s = (arm_timer_state *)g_malloc0(sizeof(arm_timer_state)); + s = g_new0(arm_timer_state, 1); s->freq = freq; s->control = TIMER_CTRL_IE; diff --git a/hw/timer/slavio_timer.c b/hw/timer/slavio_timer.c index 03e33fc592..90fdce4c44 100644 --- a/hw/timer/slavio_timer.c +++ b/hw/timer/slavio_timer.c @@ -400,7 +400,7 @@ static void slavio_timer_init(Object *obj) uint64_t size; char timer_name[20]; - tc = g_malloc0(sizeof(TimerContext)); + tc = g_new0(TimerContext, 1); tc->s = s; tc->timer_index = i; |