Skip to content

Commit

Permalink
style: Add parens to the disp expr
Browse files Browse the repository at this point in the history
Add parentheses to the displacement expression
to prevent priority issues after macro expansion.

Signed-off-by: James Roy <[email protected]>
  • Loading branch information
rruuaanng committed Dec 26, 2024
1 parent d740201 commit 573f516
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/zephyr/dt-bindings/pinctrl/rpi-pico-pinctrl-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Check warning on line 23 in include/zephyr/dt-bindings/pinctrl/rpi-pico-pinctrl-common.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LONG_LINE

include/zephyr/dt-bindings/pinctrl/rpi-pico-pinctrl-common.h:23 line length of 115 exceeds 100 columns

/* 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
Expand Down

0 comments on commit 573f516

Please sign in to comment.