lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250410071749.30505-10-ps.report@gmx.net>
Date: Thu, 10 Apr 2025 09:17:46 +0200
From: Peter Seiderer <ps.report@....net>
To: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
	"David S . Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Simon Horman <horms@...nel.org>,
	Peter Seiderer <ps.report@....net>
Subject: [PATCH net-next v1 09/11] net: pktgen: fix code style (WARNING: braces {} are not necessary for single statement blocks)

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@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ