LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Removing unneeded statement from tcp_ipv4.c
@ 2008-03-03 13:23 Arnd Hannemann
  2008-03-03 14:08 ` Ilpo Järvinen
  2008-03-03 18:51 ` [PATCH] " David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Arnd Hannemann @ 2008-03-03 13:23 UTC (permalink / raw)
  To: netdev; +Cc: Linux Kernel Mailing List

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  = 0;
-       }
+
        tmp_opt.tstamp_ok = tmp_opt.saw_tstamp;

        tcp_openreq_init(req, &tmp_opt, skb);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Removing unneeded statement from tcp_ipv4.c
  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   ` [PATCH-RESEND] " Arnd Hannemann
  2008-03-03 18:51 ` [PATCH] " David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Ilpo Järvinen @ 2008-03-03 14:08 UTC (permalink / raw)
  To: Arnd Hannemann; +Cc: Netdev, Linux Kernel Mailing List

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  = 0;
> -       }
> +

Please move the comment before the if (), only then can you remove those 
braces safely (without affecting readability, etc.).

>         tmp_opt.tstamp_ok = tmp_opt.saw_tstamp;
> 
>         tcp_openreq_init(req, &tmp_opt, skb);

-- 
 i.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Removing unneeded statement from tcp_ipv4.c
  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 18:51 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2008-03-03 18:51 UTC (permalink / raw)
  To: hannemann; +Cc: netdev, linux-kernel

From: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
Date: Mon, 03 Mar 2008 14:23:38 +0100

> -       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  = 0;
> -       }
> +

Please don't format it like this.

When there is a multi-line comment, you should still enclose
the basic block in braces.  It's unreadable otherwise.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH-RESEND] Removing unneeded statement from tcp_ipv4.c
  2008-03-03 14:08 ` Ilpo Järvinen
@ 2008-03-03 23:18   ` Arnd Hannemann
  2008-03-06  3:00     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Arnd Hannemann @ 2008-03-03 23:18 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: Netdev, Linux Kernel Mailing List

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);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH-RESEND] Removing unneeded statement from tcp_ipv4.c
  2008-03-03 23:18   ` [PATCH-RESEND] " Arnd Hannemann
@ 2008-03-06  3:00     ` David Miller
  2008-03-06 10:46       ` Arnd Hannemann
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2008-03-06  3:00 UTC (permalink / raw)
  To: hannemann; +Cc: ilpo.jarvinen, netdev, linux-kernel

From: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
Date: Tue, 04 Mar 2008 00:18:07 +0100

> Avoid setting tstamp_ok because this is done two lines later anyway.
> 
> Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>

Patch does not apply, your email client has corrupted the
patch by turning tabs into spaces etc.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH-RESEND] Removing unneeded statement from tcp_ipv4.c
  2008-03-06  3:00     ` David Miller
@ 2008-03-06 10:46       ` Arnd Hannemann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Hannemann @ 2008-03-06 10:46 UTC (permalink / raw)
  To: David Miller; +Cc: ilpo.jarvinen, netdev, linux-kernel

David Miller schrieb:
> From: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
> Date: Tue, 04 Mar 2008 00:18:07 +0100
> 
>> Avoid setting tstamp_ok because this is done two lines later anyway.
>>
>> Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
> 
> Patch does not apply, your email client has corrupted the
> patch by turning tabs into spaces etc.
> 
Sorry, this one should apply.

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);

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-03-06 10:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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   ` [PATCH-RESEND] " Arnd Hannemann
2008-03-06  3:00     ` David Miller
2008-03-06 10:46       ` Arnd Hannemann
2008-03-03 18:51 ` [PATCH] " David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).