From patchwork Mon May 9 16:44:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 619962 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r3SsM27rRz9t3f for ; Tue, 10 May 2016 02:44:39 +1000 (AEST) Received: from localhost ([::1]:42229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azoIP-0003el-1I for incoming@patchwork.ozlabs.org; Mon, 09 May 2016 12:44:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azoIA-0003AX-PA for qemu-devel@nongnu.org; Mon, 09 May 2016 12:44:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azoI8-0006GH-Ji for qemu-devel@nongnu.org; Mon, 09 May 2016 12:44:21 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:49111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azoI8-0006FV-E1 for qemu-devel@nongnu.org; Mon, 09 May 2016 12:44:20 -0400 Received: from ohm.aurel32.net ([2001:bc8:30d7:111::1000]) by hall.aurel32.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1azoHy-0008GN-IP; Mon, 09 May 2016 18:44:10 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.87) (envelope-from ) id 1azoHw-00088A-JY; Mon, 09 May 2016 18:44:08 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Mon, 9 May 2016 18:44:00 +0200 Message-Id: <1462812240-31204-1-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:bc8:30d7:100::1 Subject: [Qemu-devel] [PATCH] target-mips: fix call to memset in soft reset code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Weil , Leon Alrae , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Recent versions of GCC report the following error when compiling target-mips/helper.c: qemu/target-mips/helper.c:542:9: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] This is indeed correct and due to a wrong usage of sizeof(). Fix that. Cc: Stefan Weil Cc: Leon Alrae LP: https://bugs.launchpad.net/qemu/+bug/1577841 Signed-off-by: Aurelien Jarno Reviewed-by: Stefan Weil --- target-mips/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 |= (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 |= (1 << CP0St_NMI);