Skip to content

Commit 14cda51

Browse files
committed
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 <[email protected]> Change-Id: Id19231faaf033c1e7dbe703690e0dddc7aa8f346
1 parent d1c6c49 commit 14cda51

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/mmc/mmc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,7 @@ int mmc_part_switch_current_boot(void)
780780
unsigned char current_boot_part = mmc_current_boot_part();
781781
int ret;
782782

783-
if (current_boot_part != 1U &&
784-
current_boot_part != 2U) {
783+
if ((current_boot_part != 1U) && (current_boot_part != 2U)) {
785784
ERROR("Got unexpected value for active boot partition, %u\n", current_boot_part);
786785
return -EIO;
787786
}

0 commit comments

Comments
 (0)