From 0ed0d164ef26e9d74fb80d977a92ec6808f8104c Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Tue, 4 Dec 2018 16:16:06 -0800 Subject: [PATCH] arch: x86: Use macro BIT to shift bits The operation was shifiting bit using a signed constant in the left operand. Use BIT macro to do it properly. MISRA-C rule 12.2 Signed-off-by: Flavio Ceolin --- arch/x86/core/fatal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/core/fatal.c b/arch/x86/core/fatal.c index 156989f395b..0f28147a6a4 100644 --- a/arch/x86/core/fatal.c +++ b/arch/x86/core/fatal.c @@ -231,7 +231,7 @@ static FUNC_NORETURN void generic_exc_handle(unsigned int vector, printk("CPU exception %d\n", vector); break; } - if ((1 << vector) & _EXC_ERROR_CODE_FAULTS) { + if (BIT(vector) & _EXC_ERROR_CODE_FAULTS) { printk("***** Exception code: 0x%x\n", pEsf->errorCode); } _NanoFatalErrorHandler(_NANO_ERR_CPU_EXCEPTION, pEsf);