Skip to content

Commit d6b01bc

Browse files
rruuaanngkartben
authored andcommitted
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 <[email protected]>
1 parent afd16b9 commit d6b01bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/zephyr/dt-bindings/pinctrl/rpi-pico-pinctrl-common.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
#define RP2_GPIO_OVERRIDE_LOW 2
2020
#define RP2_GPIO_OVERRIDE_HIGH 3
2121

22-
#define RP2XXX_PINMUX(pin_num, alt_func) (pin_num << RP2_PIN_NUM_POS | alt_func << RP2_ALT_FUNC_POS)
22+
#define RP2XXX_PINMUX(pin_num, alt_func) \
23+
(((pin_num) << RP2_PIN_NUM_POS) | ((alt_func) << RP2_ALT_FUNC_POS))
2324

2425
/* These function are common. SoC-specific functions are defined in their
2526
* respective header file. Refer to table 279 and 642 in the RP2040 and RP2350

0 commit comments

Comments
 (0)