linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: cavium/nitrox - Remove redundant initialization of 'sg'
@ 2021-05-07  9:56 Yang Li
  2021-05-14 11:36 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-05-07  9:56 UTC (permalink / raw)
  To: herbert
  Cc: davem, nathan, ndesaulniers, linux-crypto, linux-kernel,
	clang-built-linux, Yang Li

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

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),
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: cavium/nitrox - Remove redundant initialization of 'sg'
  2021-05-07  9:56 [PATCH] crypto: cavium/nitrox - Remove redundant initialization of 'sg' Yang Li
@ 2021-05-14 11:36 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2021-05-14 11:36 UTC (permalink / raw)
  To: Yang Li
  Cc: davem, nathan, ndesaulniers, linux-crypto, linux-kernel,
	clang-built-linux

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-14 11:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07  9:56 [PATCH] crypto: cavium/nitrox - Remove redundant initialization of 'sg' Yang Li
2021-05-14 11:36 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).