OSDN Git Service

pinctrl: ingenic: Garbage-collect code paths for SoCs disabled by config
authorPaul Cercueil <paul@crapouillou.net>
Tue, 12 Apr 2022 16:22:18 +0000 (17:22 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 22 Apr 2022 20:58:23 +0000 (22:58 +0200)
commit8d2d607c6cd8c8bcbfdb8b399a1d28af27bb238d
treea379dd975189814de3197cf467759af94bfd0fbd
parentf01143f291b2e560a1641647c96e7da7b4064ddc
pinctrl: ingenic: Garbage-collect code paths for SoCs disabled by config

By being a bit smarter about how the SoC version checks are performed,
it is possible to have all the code paths that correspond to SoCs
disabled in the kernel config automatically marked as dead code by the
compiler, and therefore garbage-collected.

With this patch, when compiling a kernel that only targets the JZ4760
for instance, the driver is now about 4.5 KiB smaller.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220412162218.32509-1-paul@crapouillou.net
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-ingenic.c