From: Volker Rümelin Date: Thu, 15 May 2025 05:44:27 +0000 (+0200) Subject: hw/audio/asc: replace g_malloc0() with g_malloc() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f4b1c3db11317c4bce18fa3bbb025df7c22ea54c;p=thirdparty%2Fqemu.git hw/audio/asc: replace g_malloc0() with g_malloc() There is no need to allocate initialized memory with g_malloc0() if it's directly followed by a memset() function call. g_malloc() is sufficient. Reviewed-by: Marc-André Lureau Reviewed-by: Mark Cave-Ayland Signed-off-by: Volker Rümelin Message-Id: <20250515054429.7385-5-vr_qemu@t-online.de> --- diff --git a/hw/audio/asc.c b/hw/audio/asc.c index 6721c0d9fb..edd42d6d91 100644 --- a/hw/audio/asc.c +++ b/hw/audio/asc.c @@ -664,7 +664,7 @@ static void asc_realize(DeviceState *dev, Error **errp) s->samples = AUD_get_buffer_size_out(s->voice) >> s->shift; s->mixbuf = g_malloc0(s->samples << s->shift); - s->silentbuf = g_malloc0(s->samples << s->shift); + s->silentbuf = g_malloc(s->samples << s->shift); memset(s->silentbuf, 0x80, s->samples << s->shift); /* Add easc registers if required */