netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taichi Nishimura <awkrail01@gmail.com>
To: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org, Taichi Nishimura <awkrail01@gmail.com>
Subject: [PATCH] add braces to rt_type == RTN_BROADCAST case
Date: Tue,  9 May 2023 10:36:01 +0900	[thread overview]
Message-ID: <20230509013601.2544346-1-awkrail01@gmail.com> (raw)

Add braces to rt->rt_type == RTN_BROADCAST to make it easier
to grasp the if-else-if statement.
I think that it is ok to remove braces of rt_type == RTN_MULTICAST
because IP_UPD_PO_STATS is oneliner.

Signed-off-by: Taichi Nishimura <awkrail01@gmail.com>
---
 net/ipv4/ip_output.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 61892268e8a6..8b761e1a9e24 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -203,8 +203,9 @@ static int ip_finish_output2(struct net *net, struct sock *sk, struct sk_buff *s
 
 	if (rt->rt_type == RTN_MULTICAST) {
 		IP_UPD_PO_STATS(net, IPSTATS_MIB_OUTMCAST, skb->len);
-	} else if (rt->rt_type == RTN_BROADCAST)
+	} else if (rt->rt_type == RTN_BROADCAST) {
 		IP_UPD_PO_STATS(net, IPSTATS_MIB_OUTBCAST, skb->len);
+	}
 
 	if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops)) {
 		skb = skb_expand_head(skb, hh_len);
-- 
2.39.2


             reply	other threads:[~2023-05-09  1:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09  1:36 Taichi Nishimura [this message]
2023-05-09  1:52 ` [PATCH] add braces to rt_type == RTN_BROADCAST case 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=20230509013601.2544346-1-awkrail01@gmail.com \
    --to=awkrail01@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).