diff mbox series

[net-next,v1,09/11] net: pktgen: fix code style (WARNING: braces {} are not necessary for single statement blocks)

Message ID 20250410071749.30505-10-ps.report@gmx.net (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: pktgen: fix checkpatch code style errors/warnings | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch warning CHECK: Unnecessary parentheses around 'pkt_dev->svlan_id != 0xffff' CHECK: Unnecessary parentheses around 'pkt_dev->vlan_id != 0xffff' Commit 679ef17dace3 ("net: pktgen: fix code style (WARNING: braces {} are not necessary for single statement blocks)") has style problems, please review.
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-04-11--03-00 (tests: 900)

Commit Message

Peter Seiderer April 10, 2025, 7:17 a.m. UTC
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(-)

Comments

Jakub Kicinski April 14, 2025, 9:51 p.m. UTC | #1
On Thu, 10 Apr 2025 09:17:46 +0200 Peter Seiderer wrote:
> Fix checkpatch code style warnings:

The code is fine, these aren't worth addressing.
diff mbox series

Patch

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);
 				}
 			}