netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Dave Jones <davej@redhat.com>, Yuchung Cheng <ycheng@google.com>
Cc: netdev@vger.kernel.org, Neal Cardwell <ncardwell@google.com>
Subject: Re: [rfc] suspicious indentation in do_tcp_setsockopt
Date: Wed, 04 Sep 2013 21:43:16 -0700	[thread overview]
Message-ID: <1378356196.1787.74.camel@joe-AO722> (raw)
In-Reply-To: <20130905042045.GD15824@redhat.com>

(Adding Yuchung Cheng and Neal Cardwell as the
 author and acker of the patch)

On Thu, 2013-09-05 at 00:20 -0400, Dave Jones wrote:
> What's the intent here ?
> 
> This ?

I think the first is most likely.

> 
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index b2f6c74..95544e4 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -2454,10 +2454,11 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
>  	case TCP_THIN_DUPACK:
>  		if (val < 0 || val > 1)
>  			err = -EINVAL;
> -		else
> +		else {
>  			tp->thin_dupack = val;
>  			if (tp->thin_dupack)
>  				tcp_disable_early_retrans(tp);
> +		}
>  		break;
>  
>  	case TCP_REPAIR:
> 
> Or this ...
> 
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index b2f6c74..187c5a4 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -2456,8 +2456,9 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
>  			err = -EINVAL;
>  		else
>  			tp->thin_dupack = val;
> -			if (tp->thin_dupack)
> -				tcp_disable_early_retrans(tp);
> +
> +		if (tp->thin_dupack)
> +			tcp_disable_early_retrans(tp);
>  		break;
>  
>  	case TCP_REPAIR:
> 
> 
> I'll submit the right patch in the right form once I know what was intended.
> 
> The former seems more 'correct' to me, but I'm unsure if that could break something.
> 
> 	Dave
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  parent reply	other threads:[~2013-09-05  4:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-05  4:20 [rfc] suspicious indentation in do_tcp_setsockopt Dave Jones
2013-09-05  4:39 ` David Miller
2013-09-05  4:43   ` Dave Jones
2013-09-05  4:53     ` Joe Perches
2013-09-05  7:42     ` Daniel Borkmann
2013-09-05  4:43 ` Joe Perches [this message]
2013-09-05 17:24   ` Neal Cardwell
2013-09-05 17:34     ` Yuchung Cheng

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=1378356196.1787.74.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=davej@redhat.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=ycheng@google.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;
as well as URLs for NNTP newsgroup(s).