linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irqchip/stm32: fix non-SMP build warning
@ 2018-06-05 11:43 Arnd Bergmann
  2018-06-05 11:59 ` Ludovic BARRE
  2018-06-06 10:10 ` [tip:irq/urgent] irqchip/stm32: Fix " tip-bot for Arnd Bergmann
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-06-05 11:43 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier, Maxime Coquelin,
	Alexandre Torgue
  Cc: Arnd Bergmann, Ludovic Barre, Rob Herring, Benjamin Gaignard,
	Radoslaw Pietrzyk, linux-kernel, linux-arm-kernel

Without CONFIG_SMP, we get a harmless compile-time warning:

drivers/irqchip/irq-stm32-exti.c:495:12: error: 'stm32_exti_h_set_affinity' defined but not used [-Werror=unused-function]

The #ifdef is inconsistent here, and it's better to use an IS_ENABLED() check
that lets the compiler silently drop that function.

Fixes: 927abfc4461e ("irqchip/stm32: Add stm32mp1 support with hierarchy domain")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/irqchip/irq-stm32-exti.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c
index 5089c1e2838d..3a7e8905a97e 100644
--- a/drivers/irqchip/irq-stm32-exti.c
+++ b/drivers/irqchip/irq-stm32-exti.c
@@ -552,9 +552,7 @@ static struct irq_chip stm32_exti_h_chip = {
 	.irq_set_type		= stm32_exti_h_set_type,
 	.irq_set_wake		= stm32_exti_h_set_wake,
 	.flags			= IRQCHIP_MASK_ON_SUSPEND,
-#ifdef CONFIG_SMP
-	.irq_set_affinity	= stm32_exti_h_set_affinity,
-#endif
+	.irq_set_affinity	= IS_ENABLED(CONFIG_SMP) ? stm32_exti_h_set_affinity : NULL,
 };
 
 static int stm32_exti_h_domain_alloc(struct irq_domain *dm,
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] irqchip/stm32: fix non-SMP build warning
  2018-06-05 11:43 [PATCH] irqchip/stm32: fix non-SMP build warning Arnd Bergmann
@ 2018-06-05 11:59 ` Ludovic BARRE
  2018-06-06 10:10 ` [tip:irq/urgent] irqchip/stm32: Fix " tip-bot for Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic BARRE @ 2018-06-05 11:59 UTC (permalink / raw)
  To: Arnd Bergmann, Thomas Gleixner, Jason Cooper, Marc Zyngier,
	Maxime Coquelin, Alexandre Torgue
  Cc: Rob Herring, Benjamin Gaignard, Radoslaw Pietrzyk, linux-kernel,
	linux-arm-kernel



On 06/05/2018 01:43 PM, Arnd Bergmann wrote:
> Without CONFIG_SMP, we get a harmless compile-time warning:
> 
> drivers/irqchip/irq-stm32-exti.c:495:12: error: 'stm32_exti_h_set_affinity' defined but not used [-Werror=unused-function]
> 
> The #ifdef is inconsistent here, and it's better to use an IS_ENABLED() check
> that lets the compiler silently drop that function.
> 
> Fixes: 927abfc4461e ("irqchip/stm32: Add stm32mp1 support with hierarchy domain")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/irqchip/irq-stm32-exti.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c
> index 5089c1e2838d..3a7e8905a97e 100644
> --- a/drivers/irqchip/irq-stm32-exti.c
> +++ b/drivers/irqchip/irq-stm32-exti.c
> @@ -552,9 +552,7 @@ static struct irq_chip stm32_exti_h_chip = {
>   	.irq_set_type		= stm32_exti_h_set_type,
>   	.irq_set_wake		= stm32_exti_h_set_wake,
>   	.flags			= IRQCHIP_MASK_ON_SUSPEND,
> -#ifdef CONFIG_SMP
> -	.irq_set_affinity	= stm32_exti_h_set_affinity,
> -#endif
> +	.irq_set_affinity	= IS_ENABLED(CONFIG_SMP) ? stm32_exti_h_set_affinity : NULL,

thanks Arnd, sorry to forgotten config flag test

Reviewed-by: Ludovic Barre <ludovic.barre@st.com>

>   };
>   
>   static int stm32_exti_h_domain_alloc(struct irq_domain *dm,
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:irq/urgent] irqchip/stm32: Fix non-SMP build warning
  2018-06-05 11:43 [PATCH] irqchip/stm32: fix non-SMP build warning Arnd Bergmann
  2018-06-05 11:59 ` Ludovic BARRE
@ 2018-06-06 10:10 ` tip-bot for Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Arnd Bergmann @ 2018-06-06 10:10 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: alexandre.torgue, linux-kernel, marc.zyngier, hpa, tglx,
	radoslaw.pietrzyk, benjamin.gaignard, jason, mcoquelin.stm32,
	ludovic.barre, robh, mingo, arnd

Commit-ID:  a84277bf3efcc7bb5b5a5eec62de5c134cb47ee5
Gitweb:     https://git.kernel.org/tip/a84277bf3efcc7bb5b5a5eec62de5c134cb47ee5
Author:     Arnd Bergmann <arnd@arndb.de>
AuthorDate: Tue, 5 Jun 2018 13:43:34 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 6 Jun 2018 12:05:19 +0200

irqchip/stm32: Fix non-SMP build warning

A CONFIG_SMP=n build emits a harmless compile-time warning:

drivers/irqchip/irq-stm32-exti.c:495:12: error: 'stm32_exti_h_set_affinity' defined but not used [-Werror=unused-function]

The #ifdef is inconsistent here, and it's better to use an IS_ENABLED() check
that lets the compiler silently drop that function.

Fixes: 927abfc4461e ("irqchip/stm32: Add stm32mp1 support with hierarchy domain")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ludovic Barre <ludovic.barre@st.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Radoslaw Pietrzyk <radoslaw.pietrzyk@gmail.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Link: https://lkml.kernel.org/r/20180605114347.1347128-1-arnd@arndb.de

---
 drivers/irqchip/irq-stm32-exti.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c
index 5089c1e2838d..3a7e8905a97e 100644
--- a/drivers/irqchip/irq-stm32-exti.c
+++ b/drivers/irqchip/irq-stm32-exti.c
@@ -552,9 +552,7 @@ static struct irq_chip stm32_exti_h_chip = {
 	.irq_set_type		= stm32_exti_h_set_type,
 	.irq_set_wake		= stm32_exti_h_set_wake,
 	.flags			= IRQCHIP_MASK_ON_SUSPEND,
-#ifdef CONFIG_SMP
-	.irq_set_affinity	= stm32_exti_h_set_affinity,
-#endif
+	.irq_set_affinity	= IS_ENABLED(CONFIG_SMP) ? stm32_exti_h_set_affinity : NULL,
 };
 
 static int stm32_exti_h_domain_alloc(struct irq_domain *dm,

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-06 10:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05 11:43 [PATCH] irqchip/stm32: fix non-SMP build warning Arnd Bergmann
2018-06-05 11:59 ` Ludovic BARRE
2018-06-06 10:10 ` [tip:irq/urgent] irqchip/stm32: Fix " tip-bot for Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).