Skip to content

Commit 465c1ab

Browse files
ColinIanKingPaolo Abeni
authored andcommitted
net: tcp: Remove redundant initialization of variable len
The variable len being initialized with a value that is never read, an if statement is initializing it in both paths of the if statement. The initialization is redundant and can be removed. Cleans up clang scan build warning: net/ipv4/tcp_ao.c:512:11: warning: Value stored to 'len' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Dmitry Safonov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent bb18fc7 commit 465c1ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/tcp_ao.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,9 @@ static int tcp_ao_hash_header(struct tcp_sigpool *hp,
509509
bool exclude_options, u8 *hash,
510510
int hash_offset, int hash_len)
511511
{
512-
int err, len = th->doff << 2;
513512
struct scatterlist sg;
514513
u8 *hdr = hp->scratch;
514+
int err, len;
515515

516516
/* We are not allowed to change tcphdr, make a local copy */
517517
if (exclude_options) {

0 commit comments

Comments
 (0)