From patchwork Thu Sep 5 04:20:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Jones X-Patchwork-Id: 272789 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C6AF52C00B7 for ; Thu, 5 Sep 2013 14:21:12 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756607Ab3IEEUy (ORCPT ); Thu, 5 Sep 2013 00:20:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26012 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756464Ab3IEEUx (ORCPT ); Thu, 5 Sep 2013 00:20:53 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r854KrYq011223 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 5 Sep 2013 00:20:53 -0400 Received: from gelk.kernelslacker.org (ovpn-113-166.phx2.redhat.com [10.3.113.166]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r854KluZ010962 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 5 Sep 2013 00:20:53 -0400 Received: from gelk.kernelslacker.org (localhost [127.0.0.1]) by gelk.kernelslacker.org (8.14.7/8.14.7) with ESMTP id r854KkPB021876 for ; Thu, 5 Sep 2013 00:20:46 -0400 Received: (from davej@localhost) by gelk.kernelslacker.org (8.14.7/8.14.7/Submit) id r854Kj5B021875 for netdev@vger.kernel.org; Thu, 5 Sep 2013 00:20:45 -0400 X-Authentication-Warning: gelk.kernelslacker.org: davej set sender to davej@redhat.com using -f Date: Thu, 5 Sep 2013 00:20:45 -0400 From: Dave Jones To: netdev@vger.kernel.org Subject: [rfc] suspicious indentation in do_tcp_setsockopt Message-ID: <20130905042045.GD15824@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org What's the intent here ? This ? 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 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: