[PATCH 10/25] pinctrl: mediatek: pinctrl-mtk-common-v2: Mark 'mtk_default_register_base_names' as __maybe_unused
Sean Wang
sean.wang at kernel.org
Tue Jul 14 17:21:54 EDT 2020
On Mon, Jul 13, 2020 at 7:49 AM Lee Jones <lee.jones at linaro.org> wrote:
>
> Not all sourcefiles which end up including pinctrl-mtk-common-v2.h make use
> of 'mtk_default_register_base_names' and there is nowhere we can place the
> definition to void the need for __maybe_unused except its own headerfile,
> which seems like overkill. So instead we tell the compiler that it's okay
> for it to be unused by some of the consumers.
>
> Fixes the following W=1 kernel build warning(s):
>
> In file included from drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:19:
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h:83:27: warning: ‘mtk_default_register_base_names’ defined but not used [-Wunused-const-variable=]
> 83 | static const char const mtk_default_register_base_names[] = {
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from drivers/pinctrl/mediatek/pinctrl-moore.h:25,
> from drivers/pinctrl/mediatek/pinctrl-moore.c:12:
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h:83:27: warning: ‘mtk_default_register_base_names’ defined but not used [-Wunused-const-variable=]
> 83 | static const char const mtk_default_register_base_names[] = {
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from drivers/pinctrl/mediatek/pinctrl-paris.h:27,
> from drivers/pinctrl/mediatek/pinctrl-paris.c:15:
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h:83:27: warning: ‘mtk_default_register_base_names’ defined but not used [-Wunused-const-variable=]
> 83 | static const char const mtk_default_register_base_names[] = {
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from drivers/pinctrl/mediatek/pinctrl-paris.h:27,
> from drivers/pinctrl/mediatek/pinctrl-mtk-mt6797.h:15,
> from drivers/pinctrl/mediatek/pinctrl-mt6797.c:13:
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h:83:27: warning: ‘mtk_default_register_base_names’ defined but not used [-Wunused-const-variable=]
> 83 | static const char const mtk_default_register_base_names[] = {
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from drivers/pinctrl/mediatek/pinctrl-paris.h:27,
> from drivers/pinctrl/mediatek/pinctrl-mtk-mt8183.h:12,
> from drivers/pinctrl/mediatek/pinctrl-mt8183.c:9:
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h:83:27: warning: ‘mtk_default_register_base_names’ defined but not used [-Wunused-const-variable=]
> 83 | static const char const mtk_default_register_base_names[] = {
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from drivers/pinctrl/mediatek/pinctrl-paris.h:27,
> from drivers/pinctrl/mediatek/pinctrl-mtk-mt6765.h:12,
> from drivers/pinctrl/mediatek/pinctrl-mt6765.c:10:
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h:83:27: warning: ‘mtk_default_register_base_names’ defined but not used [-Wunused-const-variable=]
> 83 | static const char const mtk_default_register_base_names[] = {
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Cc: Sean Wang <sean.wang at kernel.org>
> Cc: Matthias Brugger <matthias.bgg at gmail.com>
> Cc: linux-mediatek at lists.infradead.org
> Signed-off-by: Lee Jones <lee.jones at linaro.org>
Those MediaTek SoCs with multiple register bases wouldn't refer to the array
Acked-by: Sean Wang <sean.wang at kernel.org>
> ---
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h | 2 +-
More information about the Linux-mediatek
mailing list