All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] xen/arm: smmuv3: mark arm_smmu_disable_pasid __maybe_unused
@ 2022-12-15 21:26 Stewart Hildebrand
  2022-12-20  9:35 ` Julien Grall
  0 siblings, 1 reply; 2+ messages in thread
From: Stewart Hildebrand @ 2022-12-15 21:26 UTC (permalink / raw)
  To: xen-devel
  Cc: Stewart Hildebrand, Bertrand Marquis, Rahul Singh,
	Stefano Stabellini, Julien Grall, Volodymyr Babchuk

When building with clang 12 and CONFIG_ARM_SMMU_V3=y, we observe the
following build error:

drivers/passthrough/arm/smmu-v3.c:1408:20: error: unused function 'arm_smmu_disable_pasid' [-Werror,-Wunused-function]
static inline void arm_smmu_disable_pasid(struct arm_smmu_master *master) { }
                   ^

arm_smmu_disable_pasid is not currently called from anywhere in Xen, but
it is inside a section of code guarded by CONFIG_PCI_ATS, which may be
helpful in the future if the PASID feature is to be implemented. Add the
attribute __maybe_unused to the function.

Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
Reviewed-by: Rahul Singh <rahul.singh@arm.com>
---
v2->v3:
Place __maybe_unused after "void" and add newline after __maybe_unused
Add Rahul's R-b

v1->v2:
Add __maybe_unused attribute instead of removing
---
 xen/drivers/passthrough/arm/smmu-v3.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/arm/smmu-v3.c b/xen/drivers/passthrough/arm/smmu-v3.c
index 9c9f4630090e..d58c5cd0bf77 100644
--- a/xen/drivers/passthrough/arm/smmu-v3.c
+++ b/xen/drivers/passthrough/arm/smmu-v3.c
@@ -1376,7 +1376,8 @@ static int arm_smmu_enable_pasid(struct arm_smmu_master *master)
 	return 0;
 }
 
-static void arm_smmu_disable_pasid(struct arm_smmu_master *master)
+static void __maybe_unused
+arm_smmu_disable_pasid(struct arm_smmu_master *master)
 {
 	struct pci_dev *pdev;
 
@@ -1405,7 +1406,8 @@ static inline int arm_smmu_enable_pasid(struct arm_smmu_master *master)
 	return 0;
 }
 
-static inline void arm_smmu_disable_pasid(struct arm_smmu_master *master) { }
+static inline void __maybe_unused
+arm_smmu_disable_pasid(struct arm_smmu_master *master) { }
 #endif /* CONFIG_PCI_ATS */
 
 static void arm_smmu_detach_dev(struct arm_smmu_master *master)
-- 
2.39.0



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

* Re: [PATCH v3] xen/arm: smmuv3: mark arm_smmu_disable_pasid __maybe_unused
  2022-12-15 21:26 [PATCH v3] xen/arm: smmuv3: mark arm_smmu_disable_pasid __maybe_unused Stewart Hildebrand
@ 2022-12-20  9:35 ` Julien Grall
  0 siblings, 0 replies; 2+ messages in thread
From: Julien Grall @ 2022-12-20  9:35 UTC (permalink / raw)
  To: Stewart Hildebrand, xen-devel
  Cc: Bertrand Marquis, Rahul Singh, Stefano Stabellini, Volodymyr Babchuk

Hi,

On 15/12/2022 21:26, Stewart Hildebrand wrote:
> When building with clang 12 and CONFIG_ARM_SMMU_V3=y, we observe the
> following build error:
> 
> drivers/passthrough/arm/smmu-v3.c:1408:20: error: unused function 'arm_smmu_disable_pasid' [-Werror,-Wunused-function]
> static inline void arm_smmu_disable_pasid(struct arm_smmu_master *master) { }
>                     ^
> 
> arm_smmu_disable_pasid is not currently called from anywhere in Xen, but
> it is inside a section of code guarded by CONFIG_PCI_ATS, which may be
> helpful in the future if the PASID feature is to be implemented. Add the
> attribute __maybe_unused to the function.
> 
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> Reviewed-by: Rahul Singh <rahul.singh@arm.com>

I have committed the patch.

Cheers,

-- 
Julien Grall


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

end of thread, other threads:[~2022-12-20  9:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-15 21:26 [PATCH v3] xen/arm: smmuv3: mark arm_smmu_disable_pasid __maybe_unused Stewart Hildebrand
2022-12-20  9:35 ` Julien Grall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.