diff mbox

crypto: algboss: remove redundant setting of len to zero

Message ID 20170914180219.12994-1-colin.king@canonical.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Colin King Sept. 14, 2017, 6:02 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable len is set to zero, never read and then later updated
to p - name, so clearly the zero'ing of len is redundant and
can be removed.

Detected by clang scan-build:
" warning: Value stored to 'len' is never read"

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 crypto/algboss.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Herbert Xu Oct. 7, 2017, 4:36 a.m. UTC | #1
On Thu, Sep 14, 2017 at 07:02:19PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable len is set to zero, never read and then later updated
> to p - name, so clearly the zero'ing of len is redundant and
> can be removed.
> 
> Detected by clang scan-build:
> " warning: Value stored to 'len' is never read"
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch applied.  Thanks.
diff mbox

Patch

diff --git a/crypto/algboss.c b/crypto/algboss.c
index 960d8548171b..5e6df2a087fa 100644
--- a/crypto/algboss.c
+++ b/crypto/algboss.c
@@ -122,7 +122,6 @@  static int cryptomgr_schedule_probe(struct crypto_larval *larval)
 		int notnum = 0;
 
 		name = ++p;
-		len = 0;
 
 		for (; isalnum(*p) || *p == '-' || *p == '_'; p++)
 			notnum |= !isdigit(*p);