Skip to contentSkip to conversation

iommu/arm-smmu: Mark qcom_smmu_client_of_match as possibly unused

PATCH Superseded Jordan Crouse 2 participants 2 messages Jun 3, 2020 – Jun 4, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/arm-smmu: Mark qcom_smmu_client_of_match as possibly unused

When CONFIG_OF=n of_match_device() gets pre-processed out of existence leaving qcom-smmu_client_of_match unused. Mark it as possibly unused to keep the compiler from warning in that case.

Fixes 0e764a01015d ("iommu/arm-smmu: Allow client devices to select direct mapping")

---

 drivers/iommu/arm-smmu-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/arm-smmu-qcom.c +1 -1
index cf01d0215a39..063b4388b0ff 100644
@@ -12,7 +12,7 @@ struct qcom_smmu {
 	struct arm_smmu_device smmu;
 };
 
-static const struct of_device_id qcom_smmu_client_of_match[] = {
+static const struct __maybe_unused of_device_id qcom_smmu_client_of_match[] = {
 	{ .compatible = "qcom,adreno" },
 	{ .compatible = "qcom,mdp4" },
 	{ .compatible = "qcom,mdss" },
Signature · 1 line
2.17.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines · Jordan Crouse

When CONFIG_OF=n of_match_device() gets pre-processed out of existence leaving qcom-smmu_client_of_match unused. Mark it as possibly unused to keep the compiler from warning in that case.

Fixes 0e764a01015d ("iommu/arm-smmu: Allow client devices to select direct mapping")

---

 drivers/iommu/arm-smmu-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/arm-smmu-qcom.c +0 -0
index cf01d0215a39..063b4388b0ff 100644

drivers/iommu/arm-smmu-qcom.c struct qcom_smmu { · line 15

Quoted 5 lines
drivers/iommu/arm-smmu-qcom.c +1 -1
@@ -12,7 +12,7 @@ struct qcom_smmu {
 	struct arm_smmu_device smmu;
 };
 
-static const struct of_device_id qcom_smmu_client_of_match[] = {
+static const struct __maybe_unused of_device_id qcom_smmu_client_of_match[] = {

Yikes, I've never seen that between the 'struct' and the struct name before! I'd be inclined to stick it at the end, right before the '='.

With that:

Will