diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2018-12-12 12:01:45 +0100 |
---|---|---|
committer | Geert Uytterhoeven <geert+renesas@glider.be> | 2018-12-18 11:25:56 +0100 |
commit | 9925e879572680125c5d00ad8b807aec720b1cb6 (patch) | |
tree | 4468ff596769a1083f7a6958d819b13060733d8e /drivers/pinctrl | |
parent | pinctrl: sh-pfc: sh73a0: Add missing TO pin to tpu4_to3 group (diff) | |
download | linux-9925e879572680125c5d00ad8b807aec720b1cb6.tar.xz linux-9925e879572680125c5d00ad8b807aec720b1cb6.zip |
pinctrl: sh-pfc: Validate pins/marks in pin groups at build time
Add a build-time check, to ensure the number of pins and pin marks in a
pin group matches. This helps catching bugs early.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/sh-pfc/sh_pfc.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h index 78dc342d7b39..4892c09b27bb 100644 --- a/drivers/pinctrl/sh-pfc/sh_pfc.h +++ b/drivers/pinctrl/sh-pfc/sh_pfc.h @@ -41,7 +41,8 @@ struct sh_pfc_pin { .name = #alias, \ .pins = n##_pins, \ .mux = n##_mux, \ - .nr_pins = ARRAY_SIZE(n##_pins), \ + .nr_pins = ARRAY_SIZE(n##_pins) + \ + BUILD_BUG_ON_ZERO(sizeof(n##_pins) != sizeof(n##_mux)), \ } #define SH_PFC_PIN_GROUP(n) SH_PFC_PIN_GROUP_ALIAS(n, n) |