diff options
| author | 2022-02-21 17:24:19 +0100 | |
|---|---|---|
| committer | 2022-04-19 10:24:58 +0200 | |
| commit | 29af63443003afd41ce3b0e039ae97f0a09a87b8 (patch) | |
| tree | c661eb777e73ee3bd9d9a6bd94dec84995ed560f | |
| parent | Linux 5.18-rc1 (diff) | |
pinctrl: renesas: Simplify multiplication/shift logic
"a * (1 << b)" == "a << b".
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/31eaa3226c61ecf653e2b031307eea42a9a3d54e.1645460548.git.geert+renesas@glider.be
| -rw-r--r-- | drivers/pinctrl/renesas/sh_pfc.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/pinctrl/renesas/sh_pfc.h b/drivers/pinctrl/renesas/sh_pfc.h index 6b5836ea47de..da05eec97acc 100644 --- a/drivers/pinctrl/renesas/sh_pfc.h +++ b/drivers/pinctrl/renesas/sh_pfc.h @@ -132,9 +132,8 @@ struct pinmux_cfg_reg { .reg = r, .reg_width = r_width, \ .field_width = f_width + BUILD_BUG_ON_ZERO(r_width % f_width) + \ BUILD_BUG_ON_ZERO(sizeof((const u16 []) { ids }) / sizeof(u16) != \ - (r_width / f_width) * (1 << f_width)), \ - .enum_ids = (const u16 [(r_width / f_width) * (1 << f_width)]) \ - { ids } + (r_width / f_width) << f_width), \ + .enum_ids = (const u16 [(r_width / f_width) << f_width]) { ids } /* * Describe a config register consisting of several fields of different widths |
