linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/amd: fix unused-variable warning
@ 2018-04-20  9:28 Tobias Regnery
  2018-04-20  9:47 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Regnery @ 2018-04-20  9:28 UTC (permalink / raw)
  To: joro, iommu, linux-kernel; +Cc: bigeasy, 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")
Signed-off-by: Tobias Regnery <tobias.regnery@gmail.com>
---
 drivers/iommu/amd_iommu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 2a99f0f14795..5ba141768000 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -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);
-- 
2.17.0

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

* Re: [PATCH] iommu/amd: fix unused-variable warning
  2018-04-20  9:28 [PATCH] iommu/amd: fix unused-variable warning Tobias Regnery
@ 2018-04-20  9:47 ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2018-04-20  9:47 UTC (permalink / raw)
  To: Tobias Regnery; +Cc: joro, iommu, linux-kernel

On 2018-04-20 11:28:36 [+0200], Tobias Regnery wrote:
> 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")
> Signed-off-by: Tobias Regnery <tobias.regnery@gmail.com>

Thank you for spotting this, I am waiting for Jörg to pick up this
instead:
  http://lkml.kernel.org/r/20180404105713.633983-1-arnd@arndb.de

Sebastian

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

end of thread, other threads:[~2018-04-20  9:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-20  9:28 [PATCH] iommu/amd: fix unused-variable warning Tobias Regnery
2018-04-20  9:47 ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).