diff mbox series

dmaengine: idxd: Remove redundant variable cdev_ctx

Message ID 1620298847-33127-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Accepted
Commit 58cb138e20296dffe3b2be2beb64e5aa22846b84
Headers show
Series dmaengine: idxd: Remove redundant variable cdev_ctx | expand

Commit Message

Jiapeng Chong May 6, 2021, 11 a.m. UTC
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].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/dma/idxd/cdev.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Dave Jiang May 6, 2021, 3:07 p.m. UTC | #1
On 5/6/2021 4:00 AM, Jiapeng Chong wrote:
> 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].
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Acked-by: Dave Jiang <dave.jiang@intel.com>

Thanks.


> ---
>   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 302cba5..6c72089 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, 2:34 p.m. UTC | #2
On 06-05-21, 19:00, Jiapeng Chong wrote:
> 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
diff mbox series

Patch

diff --git a/drivers/dma/idxd/cdev.c b/drivers/dma/idxd/cdev.c
index 302cba5..6c72089 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);