mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Seiderer <ps.report@gmx.net>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Peter Seiderer <ps.report@gmx.net>
Subject: [PATCH net-next v1 09/11] net: pktgen: fix code style (WARNING: braces {} are not necessary for single statement blocks)
Date: Thu, 10 Apr 2025 09:17:46 +0200	[thread overview]
Message-ID: <20250410071749.30505-10-ps.report@gmx.net> (raw)
In-Reply-To: <20250410071749.30505-1-ps.report@gmx.net>

Fix checkpatch code style warnings:

  WARNING: braces {} are not necessary for single statement blocks
  #2538: FILE: net/core/pktgen.c:2538:
  +       if ((pkt_dev->flags & F_VID_RND) && (pkt_dev->vlan_id != 0xffff)) {
  +               pkt_dev->vlan_id = get_random_u32_below(4096);
  +       }

  WARNING: braces {} are not necessary for single statement blocks
  #2542: FILE: net/core/pktgen.c:2542:
  +       if ((pkt_dev->flags & F_SVID_RND) && (pkt_dev->svlan_id != 0xffff)) {
  +               pkt_dev->svlan_id = get_random_u32_below(4096);
  +       }

  WARNING: braces {} are not necessary for single statement blocks
  #2611: FILE: net/core/pktgen.c:2611:
  +                                       if (t > imx) {
  +                                               t = imn;
  +                                       }

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 net/core/pktgen.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index a1268be1edc6..56472d56313c 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2535,13 +2535,11 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
 						      htonl(0x000fffff));
 	}
 
-	if ((pkt_dev->flags & F_VID_RND) && (pkt_dev->vlan_id != 0xffff)) {
+	if ((pkt_dev->flags & F_VID_RND) && (pkt_dev->vlan_id != 0xffff))
 		pkt_dev->vlan_id = get_random_u32_below(4096);
-	}
 
-	if ((pkt_dev->flags & F_SVID_RND) && (pkt_dev->svlan_id != 0xffff)) {
+	if ((pkt_dev->flags & F_SVID_RND) && (pkt_dev->svlan_id != 0xffff))
 		pkt_dev->svlan_id = get_random_u32_below(4096);
-	}
 
 	if (pkt_dev->udp_src_min < pkt_dev->udp_src_max) {
 		if (pkt_dev->flags & F_UDPSRC_RND)
@@ -2608,9 +2606,8 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
 				} else {
 					t = ntohl(pkt_dev->cur_daddr);
 					t++;
-					if (t > imx) {
+					if (t > imx)
 						t = imn;
-					}
 					pkt_dev->cur_daddr = htonl(t);
 				}
 			}
-- 
2.49.0


  parent reply	other threads:[~2025-04-10  7:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10  7:17 [PATCH net-next v1 00/11] net: pktgen: fix checkpatch code style errors/warnings Peter Seiderer
2025-04-10  7:17 ` [PATCH net-next v1 01/11] net: pktgen: fix code style (ERROR: "foo * bar" should be "foo *bar") Peter Seiderer
2025-04-10  7:17 ` [PATCH net-next v1 02/11] net: pktgen: fix code style (ERROR: space prohibited after that '&') Peter Seiderer
2025-04-10  7:17 ` [PATCH net-next v1 03/11] net: pktgen: fix code style (ERROR: else should follow close brace '}') Peter Seiderer
2025-04-14 21:48   ` Jakub Kicinski
2025-04-10  7:17 ` [PATCH net-next v1 04/11] net: pktgen: fix code style (WARNING: please, no space before tabs) Peter Seiderer
2025-04-14 21:49   ` Jakub Kicinski
2025-04-10  7:17 ` [PATCH net-next v1 05/11] net: pktgen: fix code style (WARNING: suspect code indent for conditional statements) Peter Seiderer
2025-04-10  7:17 ` [PATCH net-next v1 06/11] net: pktgen: fix code style (WARNING: Block comments) Peter Seiderer
2025-04-10  7:17 ` [PATCH net-next v1 07/11] net: pktgen: fix code style (WARNING: Missing a blank line after declarations) Peter Seiderer
2025-04-10  7:17 ` [PATCH net-next v1 08/11] net: pktgen: fix code style (WARNING: macros should not use a trailing semicolon) Peter Seiderer
2025-04-10  7:17 ` Peter Seiderer [this message]
2025-04-14 21:51   ` [PATCH net-next v1 09/11] net: pktgen: fix code style (WARNING: braces {} are not necessary for single statement blocks) Jakub Kicinski
2025-04-10  7:17 ` [PATCH net-next v1 10/11] net: pktgen: fix code style (WARNING: quoted string split across lines) Peter Seiderer
2025-04-10  7:17 ` [PATCH net-next v1 11/11] net: pktgen: fix code style (WARNING: Prefer strscpy over strcpy) Peter Seiderer
2025-04-14 21:52   ` Jakub Kicinski
2025-04-10 11:24 ` [PATCH net-next v1 00/11] net: pktgen: fix checkpatch code style errors/warnings Toke Høiland-Jørgensen
2025-04-14 22:57 ` patchwork-bot+netdevbpf

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=20250410071749.30505-10-ps.report@gmx.net \
    --to=ps.report@gmx.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --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

all inboxes | Powered by JetHome®