diff mbox series

crypto: cavium/nitrox - Remove redundant initialization of 'sg'

Message ID 1620381417-44442-1-git-send-email-yang.lee@linux.alibaba.com
State Accepted
Commit 3c995c4c7575b7b248d16e765fe05c01795fcd14
Headers show
Series crypto: cavium/nitrox - Remove redundant initialization of 'sg' | expand

Commit Message

Yang Li May 7, 2021, 9:56 a.m. UTC
Pointer 'sg' is being initialized however this value is never
read as 'sg' is assigned a same value in for_each_sg().
Remove the redundant assignment.

Cleans up clang warning:

drivers/crypto/cavium/nitrox/nitrox_reqmgr.c:161:22: warning: Value
stored to 'sg' during its initialization is never read
[clang-analyzer-deadcode.DeadStores]

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu May 14, 2021, 11:36 a.m. UTC | #1
On Fri, May 07, 2021 at 05:56:57PM +0800, Yang Li wrote:
> Pointer 'sg' is being initialized however this value is never

> read as 'sg' is assigned a same value in for_each_sg().

> Remove the redundant assignment.

> 

> Cleans up clang warning:

> 

> drivers/crypto/cavium/nitrox/nitrox_reqmgr.c:161:22: warning: Value

> stored to 'sg' during its initialization is never read

> [clang-analyzer-deadcode.DeadStores]

> 

> Reported-by: Abaci Robot <abaci@linux.alibaba.com>

> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>

> ---

>  drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)


Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff mbox series

Patch

diff --git a/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c b/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
index df95ba2..bc35d4c 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
@@ -159,7 +159,7 @@  static int dma_map_inbufs(struct nitrox_softreq *sr,
 			  struct se_crypto_request *req)
 {
 	struct device *dev = DEV(sr->ndev);
-	struct scatterlist *sg = req->src;
+	struct scatterlist *sg;
 	int i, nents, ret = 0;
 
 	nents = dma_map_sg(dev, req->src, sg_nents(req->src),