Commit 465c1abc authored by Colin Ian King's avatar Colin Ian King Committed by Paolo Abeni

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: default avatarColin Ian King <colin.i.king@gmail.com>
Reviewed-by: default avatarDmitry Safonov <0x7f454c46@gmail.com>
Link: https://lore.kernel.org/r/20240216125443.2107244-1-colin.i.king@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent bb18fc7a
...@@ -509,9 +509,9 @@ static int tcp_ao_hash_header(struct tcp_sigpool *hp, ...@@ -509,9 +509,9 @@ static int tcp_ao_hash_header(struct tcp_sigpool *hp,
bool exclude_options, u8 *hash, bool exclude_options, u8 *hash,
int hash_offset, int hash_len) int hash_offset, int hash_len)
{ {
int err, len = th->doff << 2;
struct scatterlist sg; struct scatterlist sg;
u8 *hdr = hp->scratch; u8 *hdr = hp->scratch;
int err, len;
/* We are not allowed to change tcphdr, make a local copy */ /* We are not allowed to change tcphdr, make a local copy */
if (exclude_options) { if (exclude_options) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment