diff mbox series

[1/1] dmaengine: idxd: remove unused variable 'cdev_ctx'

Message ID 20210508063012.2624-1-thunder.leizhen@huawei.com (mailing list archive)
State Rejected
Headers show
Series [1/1] dmaengine: idxd: remove unused variable 'cdev_ctx' | expand

Commit Message

Zhen Lei May 8, 2021, 6:30 a.m. UTC
GCC reports the following warning with W=1:

drivers/dma/idxd/cdev.c:298:28: warning:
 variable 'cdev_ctx' set but not used [-Wunused-but-set-variable]
  298 |  struct idxd_cdev_context *cdev_ctx;
      |                            ^~~~~~~~

The variable 'cdev_ctx' is not used, remove it to fix the warning.

Fixes: 04922b7445a1 ("dmaengine: idxd: fix cdev setup and free device lifetime issues")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/dma/idxd/cdev.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Dave Jiang May 10, 2021, 12:26 a.m. UTC | #1
On 5/7/2021 11:30 PM, Zhen Lei wrote:
> GCC reports the following warning with W=1:
>
> drivers/dma/idxd/cdev.c:298:28: warning:
>   variable 'cdev_ctx' set but not used [-Wunused-but-set-variable]
>    298 |  struct idxd_cdev_context *cdev_ctx;
>        |                            ^~~~~~~~
>
> The variable 'cdev_ctx' is not used, remove it to fix the warning.
>
> Fixes: 04922b7445a1 ("dmaengine: idxd: fix cdev setup and free device lifetime issues")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>


Thank you. Issue already reported and fix posted here.

https://lore.kernel.org/dmaengine/324261b0-1fa6-29f7-071a-a3c0ac09b506@intel.com/T/#t


> ---
>   drivers/dma/idxd/cdev.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/drivers/dma/idxd/cdev.c b/drivers/dma/idxd/cdev.c
> index 302cba5ff779..6c72089ca31a 100644
> --- a/drivers/dma/idxd/cdev.c
> +++ b/drivers/dma/idxd/cdev.c
> @@ -295,9 +295,7 @@ int idxd_wq_add_cdev(struct idxd_wq *wq)
>   void idxd_wq_del_cdev(struct idxd_wq *wq)
>   {
>   	struct idxd_cdev *idxd_cdev;
> -	struct idxd_cdev_context *cdev_ctx;
>   
> -	cdev_ctx = &ictx[wq->idxd->data->type];
>   	idxd_cdev = wq->idxd_cdev;
>   	wq->idxd_cdev = NULL;
>   	cdev_device_del(&idxd_cdev->cdev, &idxd_cdev->dev);
Vinod Koul May 10, 2021, 3:57 p.m. UTC | #2
On 09-05-21, 17:26, Dave Jiang wrote:
> 
> On 5/7/2021 11:30 PM, Zhen Lei wrote:
> > GCC reports the following warning with W=1:
> > 
> > drivers/dma/idxd/cdev.c:298:28: warning:
> >   variable 'cdev_ctx' set but not used [-Wunused-but-set-variable]
> >    298 |  struct idxd_cdev_context *cdev_ctx;
> >        |                            ^~~~~~~~
> > 
> > The variable 'cdev_ctx' is not used, remove it to fix the warning.
> > 
> > Fixes: 04922b7445a1 ("dmaengine: idxd: fix cdev setup and free device lifetime issues")
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> 
> 
> Thank you. Issue already reported and fix posted here.
> 
> https://lore.kernel.org/dmaengine/324261b0-1fa6-29f7-071a-a3c0ac09b506@intel.com/T/#t

dropped this
diff mbox series

Patch

diff --git a/drivers/dma/idxd/cdev.c b/drivers/dma/idxd/cdev.c
index 302cba5ff779..6c72089ca31a 100644
--- a/drivers/dma/idxd/cdev.c
+++ b/drivers/dma/idxd/cdev.c
@@ -295,9 +295,7 @@  int idxd_wq_add_cdev(struct idxd_wq *wq)
 void idxd_wq_del_cdev(struct idxd_wq *wq)
 {
 	struct idxd_cdev *idxd_cdev;
-	struct idxd_cdev_context *cdev_ctx;
 
-	cdev_ctx = &ictx[wq->idxd->data->type];
 	idxd_cdev = wq->idxd_cdev;
 	wq->idxd_cdev = NULL;
 	cdev_device_del(&idxd_cdev->cdev, &idxd_cdev->dev);