xen/arm: smmuv3: mark arm_smmu_disable_pasid __maybe_unused
PATCH v3 1/1 xen/arm: smmuv3: mark arm_smmu_disable_pasid __maybe_unused
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.
---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(-)
xen/drivers/passthrough/arm/smmu-v3.c +4 -2
@@ -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)
Signature · 1 line
2.39.0
Hi,
Quoted 7 lines · Stewart Hildebrand
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 voidarm_smmu_disable_pasid(struct arm_smmu_master *master){ }^
Quoted 7 lines
arm_smmu_disable_pasidis not currently called from anywhere in Xen, but it is inside a section of code guarded byCONFIG_PCI_ATS, which may be helpful in the future if the PASID feature is to be implemented. Add the attribute__maybe_unusedto the function.Signed-off-by Stewart Hildebrand <[email protected]>Reviewed-by Rahul Singh <[email protected]>
I have committed the patch.
Cheers,
Signature · 1 line
Julien Grall