public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
To: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
Cc: Netdev <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH-RESEND] Removing unneeded statement from tcp_ipv4.c
Date: Tue, 04 Mar 2008 00:18:07 +0100	[thread overview]
Message-ID: <47CC872F.9020202@nets.rwth-aachen.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0803031603100.28251@kivilampi-30.cs.helsinki.fi>

Ilpo Järvinen schrieb:
> On Mon, 3 Mar 2008, Arnd Hannemann wrote:
> 
>> Avoid setting tstamp_ok because this is done two lines later anyway.
>>
>> Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
>>
>> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
>> index 00156bf..a28c4c2 100644
>> --- a/net/ipv4/tcp_ipv4.c
>> +++ b/net/ipv4/tcp_ipv4.c
>> @@ -1302,15 +1302,14 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
>>                 tmp_opt.saw_tstamp = 0;
>>         }
>>
>> -       if (tmp_opt.saw_tstamp && !tmp_opt.rcv_tsval) {
>> +       if (tmp_opt.saw_tstamp && !tmp_opt.rcv_tsval)
>>                 /* Some OSes (unknown ones, but I see them on web server, which
>>                  * contains information interesting only for windows'
>>                  * users) do not send their stamp in SYN. It is easy case.
>>                  * We simply do not advertise TS support.
>>                  */
>>                 tmp_opt.saw_tstamp = 0;
>> -               tmp_opt.tstamp_ok 
> 
> Please move the comment before the if (), only then can you remove those 
> braces safely (without affecting readability, etc.).

Avoid setting tstamp_ok because this is done two lines later anyway.

Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 00156bf..ecef356 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1302,15 +1302,14 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
                tmp_opt.saw_tstamp = 0;
        }

-       if (tmp_opt.saw_tstamp && !tmp_opt.rcv_tsval) {
-               /* Some OSes (unknown ones, but I see them on web server, which
-                * contains information interesting only for windows'
-                * users) do not send their stamp in SYN. It is easy case.
-                * We simply do not advertise TS support.
-                */
+       /* Some OSes (unknown ones, but I see them on web server, which
+        * contains information interesting only for windows'
+        * users) do not send their stamp in SYN. It is easy case.
+        * We simply do not advertise TS support.
+        */
+       if (tmp_opt.saw_tstamp && !tmp_opt.rcv_tsval)
                tmp_opt.saw_tstamp = 0;
-               tmp_opt.tstamp_ok  = 0;
-       }
+
        tmp_opt.tstamp_ok = tmp_opt.saw_tstamp;

        tcp_openreq_init(req, &tmp_opt, skb);


  reply	other threads:[~2008-03-03 23:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-03 13:23 [PATCH] Removing unneeded statement from tcp_ipv4.c Arnd Hannemann
2008-03-03 14:08 ` Ilpo Järvinen
2008-03-03 23:18   ` Arnd Hannemann [this message]
2008-03-06  3:00     ` [PATCH-RESEND] " David Miller
2008-03-06 10:46       ` Arnd Hannemann
2008-03-03 18:51 ` [PATCH] " David Miller

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=47CC872F.9020202@nets.rwth-aachen.de \
    --to=hannemann@nets.rwth-aachen.de \
    --cc=ilpo.jarvinen@helsinki.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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