From: Willy Tarreau <w@1wt.eu>
To: dzp <dzp1001167@gmail.com>
Cc: edumazet@google.com, davem@davemloft.net,
yoshfuji@linux-ipv6.org, dsahern@kernel.org, kuba@kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: remove unnecessary brackets
Date: Mon, 24 May 2021 06:43:04 +0200 [thread overview]
Message-ID: <20210524044303.GA30283@1wt.eu> (raw)
In-Reply-To: <CAKtZ4UP8pnSOtRRFsfDJQjT9SnsXcHpxiqEHXpCrjPBuPo443Q@mail.gmail.com>
On Mon, May 24, 2021 at 11:58:43AM +0800, dzp wrote:
> hi list,
> this patch remove unnecessary brackets for ipv4/tcp_output.c
>
> best regards
>
>
> From d736a5e4a966bbffed90a0647719dde750b29d06 Mon Sep 17 00:00:00 2001
> From: Zhiping du <zhipingdu@tencent.com>
> Date: Mon, 24 May 2021 03:37:36 +0800
> Subject: [PATCH] ipv4:tcp_output:remove unnecessary brackets
>
> There are too many brackets. Maybe only one bracket is enough.
>
> Signed-off-by: Zhiping Du <zhipingdu@tencent.com>
>
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index bde781f..5455de3 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -2620,7 +2620,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
> }
>
> max_segs = tcp_tso_segs(sk, mss_now);
> - while ((skb = tcp_send_head(sk))) {
> + while (skb = tcp_send_head(sk)) {
Please do not do this. They're here to avoid a compiler warning which
will suggest that it might be a "==" instead of "=", or will ask to add
extra parenthesis.
You've probably seen it when you compiled your patched code.
Willy
prev parent reply other threads:[~2021-05-24 4:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-24 3:58 remove unnecessary brackets dzp
2021-05-24 4:43 ` Willy Tarreau [this message]
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=20210524044303.GA30283@1wt.eu \
--to=w@1wt.eu \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=dzp1001167@gmail.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.