Skip to contentSkip to conversation

iommu/dma: fix variable 'cookie' set but not used

PATCH In review Qian Cai 3 participants 4 messages Jan 6, 2020 – Jan 7, 2020

Subsystems (2)
lore
Share & tools
lore

Qian Cai

author
#0 lore raw

PATCH 1/1 iommu/dma: fix variable 'cookie' set but not used

The commit c18647900ec8 ("iommu/dma: Relax locking in iommu_dma_prepare_msi()") introduced a compliation warning,

drivers/iommu/dma-iommu.c: In function 'iommu_dma_prepare_msi':
drivers/iommu/dma-iommu.c:1206:27: warning: variable 'cookie' set but not used [-Wunused-but-set-variable]

  struct iommu_dma_cookie *cookie;
                           ^~~~~~
Fixes c18647900ec8 ("iommu/dma: Relax locking in iommu_dma_prepare_msi()")
---
 drivers/iommu/dma-iommu.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/iommu/dma-iommu.c +0 -3
index c363294b3bb9..a2e96a5fd9a7 100644
@@ -1203,7 +1203,6 @@ int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr)
 {
 	struct device *dev = msi_desc_to_dev(desc);
 	struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
-	struct iommu_dma_cookie *cookie;
 	struct iommu_dma_msi_page *msi_page;
 	static DEFINE_MUTEX(msi_prepare_lock); /* see below */
 
@@ -1212,8 +1211,6 @@ int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr)
 		return 0;
 	}
 
-	cookie = domain->iova_cookie;
-
 	/*
 	 * In fact the whole prepare operation should already be serialised by
 	 * irq_domain_mutex further up the callchain, but that's pretty subtle
Signature · 1 line
2.21.0 (Apple Git-122.2)
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Qian Cai

The commit c18647900ec8 ("iommu/dma: Relax locking in iommu_dma_prepare_msi()") introduced a compliation warning,

drivers/iommu/dma-iommu.c: In function 'iommu_dma_prepare_msi':
drivers/iommu/dma-iommu.c:1206:27: warning: variable 'cookie' set but not used [-Wunused-but-set-variable]

   struct iommu_dma_cookie *cookie;
                            ^~~~~~

Fair enough... I guess this is a W=1 thing? Either way there's certainly no harm in cleaning up.

Quoted 28 lines
Fixes c18647900ec8 ("iommu/dma: Relax locking in iommu_dma_prepare_msi()")
---
  drivers/iommu/dma-iommu.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/iommu/dma-iommu.c +0 -3
index c363294b3bb9..a2e96a5fd9a7 100644
@@ -1203,7 +1203,6 @@ int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr)
  {
  	struct device *dev = msi_desc_to_dev(desc);
  	struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
-	struct iommu_dma_cookie *cookie;
  	struct iommu_dma_msi_page *msi_page;
  	static DEFINE_MUTEX(msi_prepare_lock); /* see below */
 
@@ -1212,8 +1211,6 @@ int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr)
  		return 0;
  	}
 
-	cookie = domain->iova_cookie;
-
  	/*
  	 * In fact the whole prepare operation should already be serialised by
  	 * irq_domain_mutex further up the callchain, but that's pretty subtle
author
#2 lore raw
Quoted 5 lines · Robin Murphy

Fair enough... I guess this is a W=1 thing?

Yes.

#3 lore raw
In reply to Qian Cai
Quoted 6 lines · Qian Cai

The commit c18647900ec8 ("iommu/dma: Relax locking in iommu_dma_prepare_msi()") introduced a compliation warning,

drivers/iommu/dma-iommu.c: In function 'iommu_dma_prepare_msi':
drivers/iommu/dma-iommu.c:1206:27: warning: variable 'cookie' set but not used [-Wunused-but-set-variable]

Quoted 8 lines
  struct iommu_dma_cookie *cookie;
                           ^~~~~~
Fixes c18647900ec8 ("iommu/dma: Relax locking in iommu_dma_prepare_msi()")
---
 drivers/iommu/dma-iommu.c | 3 ---
 1 file changed, 3 deletions(-)

Applied for v5.5, thanks.
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu