From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEnQN-0005Ax-Um for qemu-devel@nongnu.org; Tue, 05 Aug 2014 18:41:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEnQH-0006Dp-Um for qemu-devel@nongnu.org; Tue, 05 Aug 2014 18:41:43 -0400 Received: from qmta06.emeryville.ca.mail.comcast.net ([76.96.30.56]:58085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEnQH-0006Da-LC for qemu-devel@nongnu.org; Tue, 05 Aug 2014 18:41:37 -0400 From: Eric Blake Date: Tue, 5 Aug 2014 16:41:12 -0600 Message-Id: <1407278474-17559-2-git-send-email-eblake@redhat.com> In-Reply-To: <1407278346-17427-1-git-send-email-eblake@redhat.com> References: <1407278346-17427-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH v2 12/14] target-arm: Fix bit test in sp_el0_access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Fam Zheng , wenchaoqemu@gmail.com, Stefan Weil , Markus Armbruster , Luiz Capitulino From: Stefan Weil Static code analyzers complain about a dubious & operation used for a boolean value. The code does not test the PSTATE_SP bit as it should. Cc: Peter Maydell Signed-off-by: Stefan Weil Message-id: 1406359601-25583-1-git-send-email-sw@weilnetz.de Signed-off-by: Peter Maydell --- target-arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index a7f82f3..d709285 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1853,7 +1853,7 @@ static uint64_t aa64_dczid_read(CPUARMState *env, const ARMCPRegInfo *ri) static CPAccessResult sp_el0_access(CPUARMState *env, const ARMCPRegInfo *ri) { - if (!env->pstate & PSTATE_SP) { + if (!(env->pstate & PSTATE_SP)) { /* Access to SP_EL0 is undefined if it's being used as * the stack pointer. */ -- 1.9.3