Skip to contentSkip to conversation

dmaengine: idxd: Remove redundant variable cdev_ctx

PATCH Applied Jiapeng Chong 3 participants 3 messages May 6, 2021 – May 10, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: idxd: Remove redundant variable cdev_ctx

Variable cdev_ctx is set to '&ictx[wq->idxd->data->type]' but this value is not used, hence it is a redundant assignment and can be removed.

Clean up the following clang-analyzer warning:

drivers/dma/idxd/cdev.c:300:2: warning: Value stored to 'cdev_ctx' is never read [clang-analyzer-deadcode.DeadStores].

---
 drivers/dma/idxd/cdev.c | 2 --
 1 file changed, 2 deletions(-)
drivers/dma/idxd/cdev.c +0 -2
index 302cba5..6c72089 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
1.8.3.1
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jiapeng Chong

Variable cdev_ctx is set to '&ictx[wq->idxd->data->type]' but this value is not used, hence it is a redundant assignment and can be removed.

Clean up the following clang-analyzer warning:

drivers/dma/idxd/cdev.c:300:2: warning: Value stored to 'cdev_ctx' is never read [clang-analyzer-deadcode.DeadStores].

Thanks.

Quoted 18 lines
---
  drivers/dma/idxd/cdev.c | 2 --
  1 file changed, 2 deletions(-)
drivers/dma/idxd/cdev.c +0 -2
index 302cba5..6c72089 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 Applied
#2 lore raw
In reply to Jiapeng Chong
Quoted 8 lines · Jiapeng Chong

Variable cdev_ctx is set to '&ictx[wq->idxd->data->type]' but this value is not used, hence it is a redundant assignment and can be removed.

Clean up the following clang-analyzer warning:

drivers/dma/idxd/cdev.c:300:2: warning: Value stored to 'cdev_ctx' is never read [clang-analyzer-deadcode.DeadStores].

Applied, thanks

Signature · 1 line
~Vinod