* [PATCH] [RESEND] irqchip: armada: suppress unused-function warning
@ 2024-03-22 12:58 Arnd Bergmann
2024-03-22 13:14 ` Andrew Lunn
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2024-03-22 12:58 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Arnd Bergmann, Andrew Lunn, Gregory Clement,
Sebastian Hesselbarth, Marc Zyngier, Nathan Rossi,
linux-arm-kernel, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
armada_370_xp_msi_reenable_percpu is only defined when CONFIG_PCI_MSI
is enabled, and only called when SMP is enabled.
Without CONFIG_SMP, there are no callers, so we get a build time
warning instead:
drivers/irqchip/irq-armada-370-xp.c:319:13: error: 'armada_370_xp_msi_reenable_percpu' defined but not used [-Werror=unused-function]
319 | static void armada_370_xp_msi_reenable_percpu(void) {}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mark the function as __maybe_unused to avoid adding more complexity
to the #ifdefs.
Fixes: 8ca61cde32c1 ("irqchip/armada-370-xp: Enable MSI affinity configuration")
Link: https://lore.kernel.org/lkml/20221215170202.2441960-1-arnd@kernel.org/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I noticed this never got applied, and the warning still remains.
---
drivers/irqchip/irq-armada-370-xp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index a55528469278..4b021a67bdfe 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -316,7 +316,7 @@ static int armada_370_xp_msi_init(struct device_node *node,
return 0;
}
#else
-static void armada_370_xp_msi_reenable_percpu(void) {}
+static __maybe_unused void armada_370_xp_msi_reenable_percpu(void) {}
static inline int armada_370_xp_msi_init(struct device_node *node,
phys_addr_t main_int_phys_base)
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] [RESEND] irqchip: armada: suppress unused-function warning
2024-03-22 12:58 [PATCH] [RESEND] irqchip: armada: suppress unused-function warning Arnd Bergmann
@ 2024-03-22 13:14 ` Andrew Lunn
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2024-03-22 13:14 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Thomas Gleixner, Arnd Bergmann, Gregory Clement,
Sebastian Hesselbarth, Marc Zyngier, Nathan Rossi,
linux-arm-kernel, linux-kernel
On Fri, Mar 22, 2024 at 01:58:25PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> armada_370_xp_msi_reenable_percpu is only defined when CONFIG_PCI_MSI
> is enabled, and only called when SMP is enabled.
>
> Without CONFIG_SMP, there are no callers, so we get a build time
> warning instead:
>
> drivers/irqchip/irq-armada-370-xp.c:319:13: error: 'armada_370_xp_msi_reenable_percpu' defined but not used [-Werror=unused-function]
> 319 | static void armada_370_xp_msi_reenable_percpu(void) {}
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Mark the function as __maybe_unused to avoid adding more complexity
> to the #ifdefs.
>
> Fixes: 8ca61cde32c1 ("irqchip/armada-370-xp: Enable MSI affinity configuration")
> Link: https://lore.kernel.org/lkml/20221215170202.2441960-1-arnd@kernel.org/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-22 13:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-22 12:58 [PATCH] [RESEND] irqchip: armada: suppress unused-function warning Arnd Bergmann
2024-03-22 13:14 ` Andrew Lunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox