From d8f69aade52a20fcd2cb1c93f4a98badf23cf05c Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Wed, 8 Feb 2023 17:03:59 -0800 Subject: [PATCH] UPSTREAM: 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, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Bug: 257546262 Fixes: a5bf3cfce8cb ("iommu: Implement of_iommu_get_resv_regions()") Change-Id: Ice815df046c06efa7351351e3886e925c27ca57f Signed-off-by: Randy Dunlap Cc: Thierry Reding Cc: Joerg Roedel Cc: Will Deacon Cc: iommu@lists.linux.dev Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/20230209010359.23831-1-rdunlap@infradead.org [joro: Improve code formatting] Signed-off-by: Joerg Roedel (cherry picked from commit 4762315d1c971312d55848fdc85eee7f0b09c8f2) --- drivers/iommu/of_iommu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index fa7c63a4abbf..da271c5596fb 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -174,8 +174,10 @@ const struct iommu_ops *of_iommu_configure(struct device *dev, 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;