Skip to contentSkip to conversation

iommu/amd: fix unused-variable warning

PATCH In review Tobias Regnery 2 participants 2 messages Apr 20, 2018 IOMMU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/amd: fix unused-variable warning

The iommu_table_lock is only used by code inside an ifdef CONFIG_IRQ_REMAP block. This leads to the following warning with CONFIG_IRQ_REMAP=n:

amd_iommu.c:86:24: warning: 'iommu_table_lock' defined but not used [-Wunused-variable]

Guard the spinlock definition with the same ifdef.

Fixes ea6166f4b83e9 ("iommu/amd: Split irq_lookup_table out of the amd_iommu_devtable_lock")
---
 drivers/iommu/amd_iommu.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iommu/amd_iommu.c +2 -0
index 2a99f0f14795..5ba141768000 100644
@@ -83,7 +83,9 @@
 
 static DEFINE_SPINLOCK(amd_iommu_devtable_lock);
 static DEFINE_SPINLOCK(pd_bitmap_lock);
+#ifdef CONFIG_IRQ_REMAP
 static DEFINE_SPINLOCK(iommu_table_lock);
+#endif
 
 /* List of all available dev_data structures */
 static LLIST_HEAD(dev_data_list);
Signature · 1 line
2.17.0
#1 lore raw
Quoted 9 lines · Tobias Regnery

The iommu_table_lock is only used by code inside an ifdef CONFIG_IRQ_REMAP block. This leads to the following warning with CONFIG_IRQ_REMAP=n:

amd_iommu.c:86:24: warning: 'iommu_table_lock' defined but not used [-Wunused-variable]

Guard the spinlock definition with the same ifdef.

Fixes ea6166f4b83e9 ("iommu/amd: Split irq_lookup_table out of the amd_iommu_devtable_lock")

Thank you for spotting this, I am waiting for Jörg to pick up this instead:
http://lkml.kernel.org/r/[email protected]

Sebastian
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu