2024-03-22 12:59:42

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH] [RESEND] irqchip: armada: suppress unused-function warning

From: Arnd Bergmann <[email protected]>

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/[email protected]/
Signed-off-by: Arnd Bergmann <[email protected]>
---
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



2024-03-22 13:14:50

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH] [RESEND] irqchip: armada: suppress unused-function warning

On Fri, Mar 22, 2024 at 01:58:25PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <[email protected]>
>
> 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/[email protected]/
> Signed-off-by: Arnd Bergmann <[email protected]>

Reviewed-by: Andrew Lunn <[email protected]>

Andrew

2024-03-26 01:16:36

by tip-bot2 for Tony Luck

[permalink] [raw]
Subject: [tip: irq/urgent] irqchip/armada-370-xp: Suppress unused-function warning

The following commit has been merged into the irq/urgent branch of tip:

Commit-ID: 9e81e329508576b499b5c47ab106b5fa45ce96d9
Gitweb: https://git.kernel.org/tip/9e81e329508576b499b5c47ab106b5fa45ce96d9
Author: Arnd Bergmann <[email protected]>
AuthorDate: Fri, 22 Mar 2024 13:58:25 +01:00
Committer: Thomas Gleixner <[email protected]>
CommitterDate: Tue, 26 Mar 2024 02:12:16 +01:00

irqchip/armada-370-xp: Suppress unused-function warning

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, which results in 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")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
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 a555284..4b021a6 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)