From: Julia Lawall <Julia.Lawall@inria.fr>
To: Eric Dumazet <edumazet@google.com>
Cc: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>,
"Joe Perches" <joe@perches.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
kernel-janitors@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
"Alexey Kuznetsov" <kuznet@ms2.inr.ac.ru>,
"Hideaki YOSHIFUJI" <yoshfuji@linux-ipv6.org>,
"Jakub Kicinski" <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/5] tcp: use semicolons rather than commas to separate statements
Date: Sun, 11 Oct 2020 12:34:56 +0200 [thread overview]
Message-ID: <1602412498-32025-4-git-send-email-Julia.Lawall@inria.fr> (raw)
In-Reply-To: <1602412498-32025-1-git-send-email-Julia.Lawall@inria.fr>
Replace commas with semicolons. Commas introduce unnecessary
variability in the code structure and are hard to see. What is done
is essentially described by the following Coccinelle semantic patch
(http://coccinelle.lip6.fr/):
// <smpl>
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
---
net/ipv4/tcp_input.c | 3 ++-
net/ipv4/tcp_vegas.c | 8 ++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 02d0e2fb77c0..7ff9be52c061 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4418,7 +4418,8 @@ static void tcp_sack_maybe_coalesce(struct tcp_sock *tp)
sp[i] = sp[i + 1];
continue;
}
- this_sack++, swalk++;
+ this_sack++;
+ swalk++;
}
}
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c
index 3f51e781562a..c8003c8aad2c 100644
--- a/net/ipv4/tcp_vegas.c
+++ b/net/ipv4/tcp_vegas.c
@@ -293,10 +293,10 @@ size_t tcp_vegas_get_info(struct sock *sk, u32 ext, int *attr,
const struct vegas *ca = inet_csk_ca(sk);
if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
- info->vegas.tcpv_enabled = ca->doing_vegas_now,
- info->vegas.tcpv_rttcnt = ca->cntRTT,
- info->vegas.tcpv_rtt = ca->baseRTT,
- info->vegas.tcpv_minrtt = ca->minRTT,
+ info->vegas.tcpv_enabled = ca->doing_vegas_now;
+ info->vegas.tcpv_rttcnt = ca->cntRTT;
+ info->vegas.tcpv_rtt = ca->baseRTT;
+ info->vegas.tcpv_minrtt = ca->minRTT;
*attr = INET_DIAG_VEGASINFO;
return sizeof(struct tcpvegas_info);
next prev parent reply other threads:[~2020-10-11 11:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-11 10:34 [PATCH 0/5] net: use semicolons rather than commas to separate statements Julia Lawall
2020-10-11 10:34 ` [PATCH 1/5] rxrpc: " Julia Lawall
2020-10-12 7:00 ` David Howells
2020-10-12 7:03 ` Julia Lawall
2020-10-11 10:34 ` [PATCH 2/5] mac80211: " Julia Lawall
2020-10-11 10:34 ` Julia Lawall [this message]
2020-10-11 10:34 ` [PATCH 4/5] net/ipv6: " Julia Lawall
2020-10-11 20:05 ` Paul Moore
2020-10-11 10:34 ` [PATCH 5/5] net/tls: " Julia Lawall
2020-10-14 0:15 ` [PATCH 0/5] net: " Jakub Kicinski
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=1602412498-32025-4-git-send-email-Julia.Lawall@inria.fr \
--to=julia.lawall@inria.fr \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joe@perches.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=valdis.kletnieks@vt.edu \
--cc=yoshfuji@linux-ipv6.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