Skip to contentSkip to conversation

dmaengine: idxd: remove unused variable 'cdev_ctx'

PATCH In review Zhen Lei 3 participants 3 messages May 8, 2021 – May 10, 2021

Subsystems (2)
lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

PATCH 1/1 dmaengine: idxd: remove unused variable 'cdev_ctx'

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")
---
 drivers/dma/idxd/cdev.c | 2 --
 1 file changed, 2 deletions(-)
drivers/dma/idxd/cdev.c +0 -2
index 302cba5ff779..6c72089ca31a 100644
@@ -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);
Signature · 1 line
2.25.1
reviewer
#1 lore raw
Quoted 7 lines · Zhen Lei

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;
| ^~~~~~~~

Quoted 5 lines

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")

Thank you. Issue already reported and fix posted here.

https://lore.kernel.org/dmaengine/[email protected]/T/#t

Quoted 18 lines
---
  drivers/dma/idxd/cdev.c | 2 --
  1 file changed, 2 deletions(-)
drivers/dma/idxd/cdev.c +0 -2
index 302cba5ff779..6c72089ca31a 100644
@@ -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);
maintainer
#2 lore raw
Quoted 11 lines · Dave Jiang
Quoted 9 lines · Zhen Lei

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.

Quoted 8 lines
Quoted 3 lines
Fixes 04922b7445a1 ("dmaengine: idxd: fix cdev setup and free device lifetime issues")

Thank you. Issue already reported and fix posted here.

https://lore.kernel.org/dmaengine/[email protected]/T/#t

dropped this

Signature · 1 line
~Vinod