public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/of: mark an unused function as __maybe_unused
@ 2023-02-09  1:03 Randy Dunlap
  2023-02-09 10:45 ` Thierry Reding
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2023-02-09  1:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Thierry Reding, Joerg Roedel, Will Deacon, iommu

When CONFIG_OF_ADDRESS is not set, there is a build warning/error
about an unused function.
Annotate the function to quieten the warning/error.

../drivers/iommu/of_iommu.c:176:29: warning: 'iommu_resv_region_get_type' defined but not used [-Wunused-function]
  176 | static enum iommu_resv_type iommu_resv_region_get_type(struct device *dev, struct resource *phys,
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: a5bf3cfce8cb ("iommu: Implement of_iommu_get_resv_regions()")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Will Deacon <will@kernel.org>
Cc: iommu@lists.linux.dev
---
 drivers/iommu/of_iommu.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff -- a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
--- a/drivers/iommu/of_iommu.c
+++ b/drivers/iommu/of_iommu.c
@@ -173,8 +173,9 @@ const struct iommu_ops *of_iommu_configu
 	return ops;
 }
 
-static enum iommu_resv_type iommu_resv_region_get_type(struct device *dev, struct resource *phys,
-						       phys_addr_t start, size_t length)
+static enum iommu_resv_type __maybe_unused iommu_resv_region_get_type(struct device *dev,
+						struct resource *phys,
+						phys_addr_t start, size_t length)
 {
 	phys_addr_t end = start + length - 1;
 

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

end of thread, other threads:[~2023-02-16  9:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-09  1:03 [PATCH] iommu/of: mark an unused function as __maybe_unused Randy Dunlap
2023-02-09 10:45 ` Thierry Reding
2023-02-16  9:19   ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox