iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/renesas: fix unused-function warning
@ 2020-05-08 22:02 Arnd Bergmann
  2020-05-12  9:53 ` Simon Horman
  2020-05-13  8:58 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2020-05-08 22:02 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Hai Nguyen Pham, Joerg Roedel, Arnd Bergmann, Geert Uytterhoeven,
	Robin Murphy, linux-kernel, iommu, Simon Horman, Will Deacon

gcc warns because the only reference to ipmmu_find_group
is inside of an #ifdef:

drivers/iommu/ipmmu-vmsa.c:878:28: error: 'ipmmu_find_group' defined but not used [-Werror=unused-function]

Change the #ifdef to an equivalent IS_ENABLED().

Fixes: 6580c8a78424 ("iommu/renesas: Convert to probe/release_device() call-backs")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/iommu/ipmmu-vmsa.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index fb7e702dee23..4c2972f3153b 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -903,11 +903,8 @@ static const struct iommu_ops ipmmu_ops = {
 	.probe_device = ipmmu_probe_device,
 	.release_device = ipmmu_release_device,
 	.probe_finalize = ipmmu_probe_finalize,
-#if defined(CONFIG_ARM) && !defined(CONFIG_IOMMU_DMA)
-	.device_group = generic_device_group,
-#else
-	.device_group = ipmmu_find_group,
-#endif
+	.device_group = IS_ENABLED(CONFIG_ARM) && !IS_ENABLED(CONFIG_IOMMU_DMA)
+			? generic_device_group : ipmmu_find_group,
 	.pgsize_bitmap = SZ_1G | SZ_2M | SZ_4K,
 	.of_xlate = ipmmu_of_xlate,
 };
-- 
2.26.0

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH] iommu/renesas: fix unused-function warning
  2020-05-08 22:02 [PATCH] iommu/renesas: fix unused-function warning Arnd Bergmann
@ 2020-05-12  9:53 ` Simon Horman
  2020-05-13  8:58 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2020-05-12  9:53 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Hai Nguyen Pham, Joerg Roedel, Geert Uytterhoeven, Will Deacon,
	linux-kernel, iommu, Robin Murphy

On Sat, May 09, 2020 at 12:02:16AM +0200, Arnd Bergmann wrote:
> gcc warns because the only reference to ipmmu_find_group
> is inside of an #ifdef:
> 
> drivers/iommu/ipmmu-vmsa.c:878:28: error: 'ipmmu_find_group' defined but not used [-Werror=unused-function]
> 
> Change the #ifdef to an equivalent IS_ENABLED().
> 
> Fixes: 6580c8a78424 ("iommu/renesas: Convert to probe/release_device() call-backs")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Simon Horman <horms@verge.net.au>

> ---
>  drivers/iommu/ipmmu-vmsa.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
> index fb7e702dee23..4c2972f3153b 100644
> --- a/drivers/iommu/ipmmu-vmsa.c
> +++ b/drivers/iommu/ipmmu-vmsa.c
> @@ -903,11 +903,8 @@ static const struct iommu_ops ipmmu_ops = {
>  	.probe_device = ipmmu_probe_device,
>  	.release_device = ipmmu_release_device,
>  	.probe_finalize = ipmmu_probe_finalize,
> -#if defined(CONFIG_ARM) && !defined(CONFIG_IOMMU_DMA)
> -	.device_group = generic_device_group,
> -#else
> -	.device_group = ipmmu_find_group,
> -#endif
> +	.device_group = IS_ENABLED(CONFIG_ARM) && !IS_ENABLED(CONFIG_IOMMU_DMA)
> +			? generic_device_group : ipmmu_find_group,
>  	.pgsize_bitmap = SZ_1G | SZ_2M | SZ_4K,
>  	.of_xlate = ipmmu_of_xlate,
>  };
> -- 
> 2.26.0
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH] iommu/renesas: fix unused-function warning
  2020-05-08 22:02 [PATCH] iommu/renesas: fix unused-function warning Arnd Bergmann
  2020-05-12  9:53 ` Simon Horman
@ 2020-05-13  8:58 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2020-05-13  8:58 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Hai Nguyen Pham, Joerg Roedel, Geert Uytterhoeven, Robin Murphy,
	linux-kernel, iommu, Simon Horman, Will Deacon

On Sat, May 09, 2020 at 12:02:16AM +0200, Arnd Bergmann wrote:
> gcc warns because the only reference to ipmmu_find_group
> is inside of an #ifdef:
> 
> drivers/iommu/ipmmu-vmsa.c:878:28: error: 'ipmmu_find_group' defined but not used [-Werror=unused-function]
> 
> Change the #ifdef to an equivalent IS_ENABLED().
> 
> Fixes: 6580c8a78424 ("iommu/renesas: Convert to probe/release_device() call-backs")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/iommu/ipmmu-vmsa.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

Applied, thanks.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

end of thread, other threads:[~2020-05-13  8:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 22:02 [PATCH] iommu/renesas: fix unused-function warning Arnd Bergmann
2020-05-12  9:53 ` Simon Horman
2020-05-13  8:58 ` Joerg Roedel

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).