Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pinctrl: airoha: Fix AIROHA_PINCTRL_CONFS_DRIVE_E2 in an7583_pinctrl_match_data

Clang warns (or errors with CONFIG_WERROR=y / W=e):

pinctrl/mediatek/pinctrl-airoha.c:2064:41: error: variable 'an7583_pinctrl_drive_e2_conf' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
2064 | static const struct airoha_pinctrl_conf an7583_pinctrl_drive_e2_conf[] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Due to a typo, an7583_pinctrl_drive_e2_conf is only used within
ARRAY_SIZE() (hence no instance of -Wunused-variable), which is
evaluated at compile time, so it will not be needed in the final object
file.

Fix the .confs assignment for AIROHA_PINCTRL_CONFS_DRIVE_E2 in
an7583_pinctrl_match_data to clear up the warning.

Closes: https://github.com/ClangBuiltLinux/linux/issues/2142
Fixes: 3ffeb17a9a27 ("pinctrl: airoha: add support for Airoha AN7583 PINs")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Nathan Chancellor and committed by
Linus Walleij
0341d1b1 f2bd5a0f

+1 -1
+1 -1
drivers/pinctrl/mediatek/pinctrl-airoha.c
··· 2993 2993 .num_confs = ARRAY_SIZE(an7583_pinctrl_pulldown_conf), 2994 2994 }, 2995 2995 [AIROHA_PINCTRL_CONFS_DRIVE_E2] = { 2996 - .confs = en7581_pinctrl_drive_e2_conf, 2996 + .confs = an7583_pinctrl_drive_e2_conf, 2997 2997 .num_confs = ARRAY_SIZE(an7583_pinctrl_drive_e2_conf), 2998 2998 }, 2999 2999 [AIROHA_PINCTRL_CONFS_DRIVE_E4] = {