From 14cda5168de45bbbcce1a5152140111d4fc8fd21 Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Fri, 18 Nov 2022 15:02:35 +0100 Subject: [PATCH] fix(mmc): explicitly check operators precedence This corrects the MISRA violation C2012-12.1: The precedence of operators within expressions should be made explicit While at it put the test on one line. Signed-off-by: Yann Gautier Change-Id: Id19231faaf033c1e7dbe703690e0dddc7aa8f346 --- drivers/mmc/mmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 8e83464d5..1a63f6185 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -780,8 +780,7 @@ int mmc_part_switch_current_boot(void) unsigned char current_boot_part = mmc_current_boot_part(); int ret; - if (current_boot_part != 1U && - current_boot_part != 2U) { + if ((current_boot_part != 1U) && (current_boot_part != 2U)) { ERROR("Got unexpected value for active boot partition, %u\n", current_boot_part); return -EIO; }