From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azpN0-00039k-G8 for qemu-devel@nongnu.org; Mon, 09 May 2016 13:53:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azpMv-0005I5-9c for qemu-devel@nongnu.org; Mon, 09 May 2016 13:53:25 -0400 Received: from [2a03:4000:1::4e2f:c7ac:d] (port=55290 helo=mail.weilnetz.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azpMv-0005Gb-40 for qemu-devel@nongnu.org; Mon, 09 May 2016 13:53:21 -0400 References: <1462812240-31204-1-git-send-email-aurelien@aurel32.net> From: Stefan Weil Message-ID: <5730CE8B.1000203@weilnetz.de> Date: Mon, 9 May 2016 19:53:15 +0200 MIME-Version: 1.0 In-Reply-To: <1462812240-31204-1-git-send-email-aurelien@aurel32.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] target-mips: fix call to memset in soft reset code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno , qemu-devel@nongnu.org Cc: Leon Alrae , Peter Maydell Am 09.05.2016 um 18:44 schrieb Aurelien Jarno: > Recent versions of GCC report the following error when compiling > target-mips/helper.c: >=20 > qemu/target-mips/helper.c:542:9: warning: =E2=80=98memset=E2=80=99 us= ed with length > equal to number of elements without multiplication by element size > [-Wmemset-elt-size] >=20 > This is indeed correct and due to a wrong usage of sizeof(). Fix that. >=20 > Cc: Stefan Weil > Cc: Leon Alrae > LP: https://bugs.launchpad.net/qemu/+bug/1577841 > Signed-off-by: Aurelien Jarno > --- > target-mips/helper.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/target-mips/helper.c b/target-mips/helper.c > index 1004ede..cfea177 100644 > --- a/target-mips/helper.c > +++ b/target-mips/helper.c > @@ -539,7 +539,7 @@ void mips_cpu_do_interrupt(CPUState *cs) > break; > case EXCP_SRESET: > env->CP0_Status |=3D (1 << CP0St_SR); > - memset(env->CP0_WatchLo, 0, sizeof(*env->CP0_WatchLo)); > + memset(env->CP0_WatchLo, 0, sizeof(env->CP0_WatchLo)); > goto set_error_EPC; > case EXCP_NMI: > env->CP0_Status |=3D (1 << CP0St_NMI); >=20 Reviewed-by: Stefan Weil I suggest to apply this patch to 2.6, if this is still possible: * It is a very small modification which fixes a bug. * It fixes a new build error with recent gcc versions. The first reason alone would not justify it for 2.6 as this is a rather old bug. Stefan