pinctrl: renesas: Simplify multiplication/shift logic
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 21 Feb 2022 16:24:19 +0000 (17:24 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 19 Apr 2022 08:24:58 +0000 (10:24 +0200)
"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
drivers/pinctrl/renesas/sh_pfc.h

index 6b5836e..da05eec 100644 (file)
@@ -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