summaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorColin Ian King <colin.i.king@gmail.com>2024-02-16 15:54:43 +0300
committerPaolo Abeni <pabeni@redhat.com>2024-02-20 13:40:15 +0300
commit465c1abcb64426f0ff39e80e508e2432672c2dae (patch)
tree1042e229b27bfd289cfb4b48ce7761b40b34bad2 /net/ipv4
parentbb18fc7a521b41bfee201643f65d7b74bc6b901f (diff)
downloadlinux-465c1abcb64426f0ff39e80e508e2432672c2dae.tar.xz
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 <colin.i.king@gmail.com> Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Link: https://lore.kernel.org/r/20240216125443.2107244-1-colin.i.king@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_ao.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_ao.c b/net/ipv4/tcp_ao.c
index 87db432c6bb4..3afeeb68e8a7 100644
--- a/net/ipv4/tcp_ao.c
+++ b/net/ipv4/tcp_ao.c
@@ -509,9 +509,9 @@ static int tcp_ao_hash_header(struct tcp_sigpool *hp,
bool exclude_options, u8 *hash,
int hash_offset, int hash_len)
{
- int err, len = th->doff << 2;
struct scatterlist sg;
u8 *hdr = hp->scratch;
+ int err, len;
/* We are not allowed to change tcphdr, make a local copy */
if (exclude_options) {