Skip to contentSkip to conversation

iommu/renesas: fix unused-function warning

PATCH Applied Arnd Bergmann 3 participants 3 messages May 8, 2020 – May 13, 2020 IOMMU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/renesas: fix unused-function warning

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")
---
 drivers/iommu/ipmmu-vmsa.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/iommu/ipmmu-vmsa.c +2 -5
index fb7e702dee23..4c2972f3153b 100644
@@ -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,
 };
Signature · 1 line
2.26.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Arnd Bergmann

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")
Quoted 25 lines
---
 drivers/iommu/ipmmu-vmsa.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/iommu/ipmmu-vmsa.c +2 -5
index fb7e702dee23..4c2972f3153b 100644
@@ -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,
 };
Signature · 1 line
2.26.0
maintainer Applied
#2 lore raw
In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

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]

Quoted 7 lines

Change the #ifdef to an equivalent IS_ENABLED().

Fixes 6580c8a78424 ("iommu/renesas: Convert to probe/release_device() call-backs")
---
 drivers/iommu/ipmmu-vmsa.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Applied, thanks.