mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Safonov <0x7f454c46@gmail.com>
To: Colin Ian King <colin.i.king@gmail.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	David Ahern <dsahern@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org, Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH][next] net: tcp: Remove redundant initialization of variable len
Date: Fri, 16 Feb 2024 15:30:57 +0000	[thread overview]
Message-ID: <4f3bc406-1671-4f37-98e4-38e00590f487@gmail.com> (raw)
In-Reply-To: <CANn89iJM=fVSkzz9HRU+HXYm+R+owKqah0TT8sY-soEXf2HiNA@mail.gmail.com>

On 2/16/24 13:00, Eric Dumazet wrote:
> On Fri, Feb 16, 2024 at 1:54 PM Colin Ian King <colin.i.king@gmail.com> wrote:
>>
>> 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>

LGTM,

Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>

>> ---
>>  net/ipv4/tcp_ao.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> 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) {
>> --
>> 2.39.2
>>
> 
> Cc Dmitry Safonov
> 
> Dmitry, can you take a look ?

Thanks for Cc'ing!

> 
> Thanks !

Thanks,
             Dmitry


  reply	other threads:[~2024-02-16 15:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 12:54 Colin Ian King
2024-02-16 13:00 ` Eric Dumazet
2024-02-16 15:30   ` Dmitry Safonov [this message]
2024-02-20 10:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4f3bc406-1671-4f37-98e4-38e00590f487@gmail.com \
    --to=0x7f454c46@gmail.com \
    --cc=colin.i.king@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®