public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/dma: fix variable 'cookie' set but not used
@ 2020-01-06 15:27 Qian Cai
  2020-01-06 18:19 ` Robin Murphy
  2020-01-07 16:03 ` Joerg Roedel
  0 siblings, 2 replies; 4+ messages in thread
From: Qian Cai @ 2020-01-06 15:27 UTC (permalink / raw)
  To: jroedel; +Cc: robin.murphy, iommu, linux-kernel, 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;
                           ^~~~~~

Fixes: c18647900ec8 ("iommu/dma: Relax locking in iommu_dma_prepare_msi()")
Signed-off-by: Qian Cai <cai@lca.pw>
---
 drivers/iommu/dma-iommu.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index c363294b3bb9..a2e96a5fd9a7 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -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
-- 
2.21.0 (Apple Git-122.2)


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

* Re: [PATCH] iommu/dma: fix variable 'cookie' set but not used
  2020-01-06 15:27 [PATCH] iommu/dma: fix variable 'cookie' set but not used Qian Cai
@ 2020-01-06 18:19 ` Robin Murphy
  2020-01-06 18:44   ` Qian Cai
  2020-01-07 16:03 ` Joerg Roedel
  1 sibling, 1 reply; 4+ messages in thread
From: Robin Murphy @ 2020-01-06 18:19 UTC (permalink / raw)
  To: Qian Cai, jroedel; +Cc: iommu, linux-kernel

On 06/01/2020 3:27 pm, Qian Cai wrote:
> 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.

Acked-by: Robin Murphy <robin.murphy@arm.com>

> Fixes: c18647900ec8 ("iommu/dma: Relax locking in iommu_dma_prepare_msi()")
> Signed-off-by: Qian Cai <cai@lca.pw>
> ---
>   drivers/iommu/dma-iommu.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
> index c363294b3bb9..a2e96a5fd9a7 100644
> --- a/drivers/iommu/dma-iommu.c
> +++ b/drivers/iommu/dma-iommu.c
> @@ -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
> 

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

* Re: [PATCH] iommu/dma: fix variable 'cookie' set but not used
  2020-01-06 18:19 ` Robin Murphy
@ 2020-01-06 18:44   ` Qian Cai
  0 siblings, 0 replies; 4+ messages in thread
From: Qian Cai @ 2020-01-06 18:44 UTC (permalink / raw)
  To: Robin Murphy; +Cc: jroedel, iommu, linux-kernel



> On Jan 6, 2020, at 1:19 PM, Robin Murphy <Robin.Murphy@arm.com> wrote:
> 
> Fair enough... I guess this is a W=1 thing?

Yes.

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

* Re: [PATCH] iommu/dma: fix variable 'cookie' set but not used
  2020-01-06 15:27 [PATCH] iommu/dma: fix variable 'cookie' set but not used Qian Cai
  2020-01-06 18:19 ` Robin Murphy
@ 2020-01-07 16:03 ` Joerg Roedel
  1 sibling, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2020-01-07 16:03 UTC (permalink / raw)
  To: Qian Cai; +Cc: robin.murphy, iommu, linux-kernel

On Mon, Jan 06, 2020 at 10:27:27AM -0500, Qian Cai wrote:
> 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()")
> Signed-off-by: Qian Cai <cai@lca.pw>
> ---
>  drivers/iommu/dma-iommu.c | 3 ---
>  1 file changed, 3 deletions(-)

Applied for v5.5, thanks.

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

end of thread, other threads:[~2020-01-07 16:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-06 15:27 [PATCH] iommu/dma: fix variable 'cookie' set but not used Qian Cai
2020-01-06 18:19 ` Robin Murphy
2020-01-06 18:44   ` Qian Cai
2020-01-07 16:03 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox