Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iommu/of: mark an unused function as __maybe_unused

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
Reviewed-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20230209010359.23831-1-rdunlap@infradead.org
[joro: Improve code formatting]
Signed-off-by: Joerg Roedel <jroedel@suse.de>

authored by

Randy Dunlap and committed by
Joerg Roedel
4762315d 189d496b

+4 -2
+4 -2
drivers/iommu/of_iommu.c
··· 173 173 return ops; 174 174 } 175 175 176 - static enum iommu_resv_type iommu_resv_region_get_type(struct device *dev, struct resource *phys, 177 - phys_addr_t start, size_t length) 176 + static enum iommu_resv_type __maybe_unused 177 + iommu_resv_region_get_type(struct device *dev, 178 + struct resource *phys, 179 + phys_addr_t start, size_t length) 178 180 { 179 181 phys_addr_t end = start + length - 1; 180 182