diff mbox series

[51/88] hw/timer: use g_new() family of functions

Message ID 20171006235023.11952-52-f4bug@amsat.org
State New
Headers show
Series use g_new() family of functions | expand

Commit Message

Philippe Mathieu-Daudé Oct. 6, 2017, 11:49 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 hw/timer/slavio_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

zhao xiao qiang Oct. 7, 2017, 12:46 a.m. UTC | #1
> 在 2017年10月7日,上午7:49,Philippe Mathieu-Daudé <f4bug@amsat.org> 写道:
> 
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> hw/timer/slavio_timer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/timer/slavio_timer.c b/hw/timer/slavio_timer.c
> index a8cc9c0148..6d0282a788 100644
> --- a/hw/timer/slavio_timer.c
> +++ b/hw/timer/slavio_timer.c
> @@ -385,7 +385,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;
> 
> -- 
> 2.14.2

Reviewed-by: xiaoqiang zhao <zxq_yx_007@163.com>
zhao xiao qiang Oct. 7, 2017, 12:52 a.m. UTC | #2
> 在 2017年10月7日,上午7:49,Philippe Mathieu-Daudé <f4bug@amsat.org> 写道:
> 
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> hw/timer/slavio_timer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/timer/slavio_timer.c b/hw/timer/slavio_timer.c
> index a8cc9c0148..6d0282a788 100644
> --- a/hw/timer/slavio_timer.c
> +++ b/hw/timer/slavio_timer.c
> @@ -385,7 +385,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;
> 
> -- 
> 2.14.2

Resend due to email blocks.

Reviewed-by: xiaoqiang zhao <zxq_yx_007@163.com>
diff mbox series

Patch

diff --git a/hw/timer/slavio_timer.c b/hw/timer/slavio_timer.c
index a8cc9c0148..6d0282a788 100644
--- a/hw/timer/slavio_timer.c
+++ b/hw/timer/slavio_timer.c
@@ -385,7 +385,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;