From d6b01bc8a0551323fc32e36f830de4ce44f41739 Mon Sep 17 00:00:00 2001 From: James Roy Date: Thu, 26 Dec 2024 23:18:27 +0800 Subject: [PATCH] style: Add parens to the disp expr Add parentheses to the displacement expression to prevent priority issues after macro expansion. Signed-off-by: James Roy --- include/zephyr/dt-bindings/pinctrl/rpi-pico-pinctrl-common.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/zephyr/dt-bindings/pinctrl/rpi-pico-pinctrl-common.h b/include/zephyr/dt-bindings/pinctrl/rpi-pico-pinctrl-common.h index 3ac8340988b1..059c81dcca4d 100644 --- a/include/zephyr/dt-bindings/pinctrl/rpi-pico-pinctrl-common.h +++ b/include/zephyr/dt-bindings/pinctrl/rpi-pico-pinctrl-common.h @@ -19,7 +19,8 @@ #define RP2_GPIO_OVERRIDE_LOW 2 #define RP2_GPIO_OVERRIDE_HIGH 3 -#define RP2XXX_PINMUX(pin_num, alt_func) (pin_num << RP2_PIN_NUM_POS | alt_func << RP2_ALT_FUNC_POS) +#define RP2XXX_PINMUX(pin_num, alt_func) \ + (((pin_num) << RP2_PIN_NUM_POS) | ((alt_func) << RP2_ALT_FUNC_POS)) /* These function are common. SoC-specific functions are defined in their * respective header file. Refer to table 279 and 642 in the RP2040 and RP2350