pinctrl: sh-pfc: Validate enum IDs for regs with variable-width fields
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 13 Dec 2018 14:48:45 +0000 (15:48 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 2 Apr 2019 07:58:07 +0000 (09:58 +0200)
commitfa4d36712f20e2425171ab1f62341ebb6416d3ea
tree2be6017e307c6e142f130f918b2068327c5b3674
parentc481c8178420b8cc8b188807fe6eee8b069ce2d8
pinctrl: sh-pfc: Validate enum IDs for regs with variable-width fields

Add a run-time check to the PINMUX_CFG_REG_VAR() macro, to ensure the
number of provided enum IDs is correct.  This cannot be done at build
time, as the number of values depends on the variable-width fields in
the config register.

This helps catching bugs early.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/pinctrl/sh-pfc/core.c
drivers/pinctrl/sh-pfc/sh_pfc.h