* [PATCH] pinctrl: tegra: avoid duplicate field initializers
@ 2023-06-16 16:15 Arnd Bergmann
2023-06-19 8:54 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2023-06-16 16:15 UTC (permalink / raw)
To: Linus Walleij, Thierry Reding, Jonathan Hunter
Cc: Arnd Bergmann, Prathamesh Shete, Andy Shevchenko, linux-gpio,
linux-tegra, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
The drv_reg field is initialized both in the DRV_PINGROUP_ENTRY_N/DRV_PINGROUP_ENTRY_Y
macros and in DRV_PINGROUP_Y. Since each pingroup expands both macros, the are
always duplicate and turning on -Woverride-init (which is disabled by default)
causes a huge amount of warnings like:
drivers/pinctrl/tegra/pinctrl-tegra234.c:1384:27: error: initialized field overwritten [-Werror=override-init]
1384 | #define DRV_PINGROUP_Y(r) ((r))
| ^
drivers/pinctrl/tegra/pinctrl-tegra234.c:1397:28: note: in expansion of macro 'DRV_PINGROUP_Y'
1397 | .drv_reg = DRV_PINGROUP_Y(r), \
| ^~~~~~~~~~~~~~
drivers/pinctrl/tegra/pinctrl-tegra234.c:1447:49: note: in expansion of macro 'DRV_PINGROUP_ENTRY_Y'
1447 | #define drive_soc_gpio08_pb0 DRV_PINGROUP_ENTRY_Y(0x500c, 12, 5, 20, 5, -1, -1, -1, -1, 0)
| ^~~~~~~~~~~~~~~~~~~~
...
Remove the intialization that is never used here.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/pinctrl/tegra/pinctrl-tegra234.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/pinctrl/tegra/pinctrl-tegra234.c b/drivers/pinctrl/tegra/pinctrl-tegra234.c
index fd70725392162..86c2b84e792d9 100644
--- a/drivers/pinctrl/tegra/pinctrl-tegra234.c
+++ b/drivers/pinctrl/tegra/pinctrl-tegra234.c
@@ -1442,7 +1442,6 @@ static const char * const tegra234_functions[] = {
.schmitt_bit = schmitt_b, \
.drvtype_bit = 13, \
.lpdr_bit = e_lpdr, \
- .drv_reg = -1, \
/* main drive pin groups */
#define drive_soc_gpio08_pb0 DRV_PINGROUP_ENTRY_Y(0x500c, 12, 5, 20, 5, -1, -1, -1, -1, 0)
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pinctrl: tegra: avoid duplicate field initializers
2023-06-16 16:15 [PATCH] pinctrl: tegra: avoid duplicate field initializers Arnd Bergmann
@ 2023-06-19 8:54 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2023-06-19 8:54 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Thierry Reding, Jonathan Hunter, Arnd Bergmann, Prathamesh Shete,
Andy Shevchenko, linux-gpio, linux-tegra, linux-kernel
On Fri, Jun 16, 2023 at 6:16 PM Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The drv_reg field is initialized both in the DRV_PINGROUP_ENTRY_N/DRV_PINGROUP_ENTRY_Y
> macros and in DRV_PINGROUP_Y. Since each pingroup expands both macros, the are
> always duplicate and turning on -Woverride-init (which is disabled by default)
> causes a huge amount of warnings like:
>
> drivers/pinctrl/tegra/pinctrl-tegra234.c:1384:27: error: initialized field overwritten [-Werror=override-init]
> 1384 | #define DRV_PINGROUP_Y(r) ((r))
> | ^
> drivers/pinctrl/tegra/pinctrl-tegra234.c:1397:28: note: in expansion of macro 'DRV_PINGROUP_Y'
> 1397 | .drv_reg = DRV_PINGROUP_Y(r), \
> | ^~~~~~~~~~~~~~
> drivers/pinctrl/tegra/pinctrl-tegra234.c:1447:49: note: in expansion of macro 'DRV_PINGROUP_ENTRY_Y'
> 1447 | #define drive_soc_gpio08_pb0 DRV_PINGROUP_ENTRY_Y(0x500c, 12, 5, 20, 5, -1, -1, -1, -1, 0)
> | ^~~~~~~~~~~~~~~~~~~~
> ...
>
> Remove the intialization that is never used here.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Patch applied!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-19 8:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-16 16:15 [PATCH] pinctrl: tegra: avoid duplicate field initializers Arnd Bergmann
2023-06-19 8:54 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox