diff --git a/board/drivers/gpio.h b/board/drivers/gpio.h index 4f0202ad06..0b8fc091b1 100644 --- a/board/drivers/gpio.h +++ b/board/drivers/gpio.h @@ -58,7 +58,7 @@ void set_gpio_alternate(GPIO_TypeDef *GPIO, unsigned int pin, unsigned int mode) void set_gpio_pullup(GPIO_TypeDef *GPIO, unsigned int pin, unsigned int mode) { ENTER_CRITICAL(); uint32_t tmp = GPIO->PUPDR; - tmp &= ~((uint32_t)3U << ((uint32_t)(pin * 2U))); + tmp &= ~(3U << (pin * 2U)); tmp |= (mode << (pin * 2U)); register_set(&(GPIO->PUPDR), tmp, 0xFFFFFFFFU); EXIT_CRITICAL(); diff --git a/tests/misra/suppressions.txt b/tests/misra/suppressions.txt index 4800a270bc..0fb0377dca 100644 --- a/tests/misra/suppressions.txt +++ b/tests/misra/suppressions.txt @@ -19,3 +19,4 @@ unusedFunction:*/interrupt_handlers*.h # cppcheck from 2.5 -> 2.13. they are listed here to separate the update from # fixing the violations and all are intended to be removed soon after misra-c2012-2.5 # unused macros. a few legit, rest aren't common between F4/H7 builds. should we do this in the unusedFunction pass? +misra-c2012-12.2:*/gpio.h # Suppress 12.2 for any file named gpio.h