diff mbox series

[net-next,v1,07/11] net: pktgen: fix code style (WARNING: Missing a blank line after declarations)

Message ID 20250410071749.30505-8-ps.report@gmx.net (mailing list archive)
State Superseded
Commit ca8ee665211ac64d38caa553cc04527b22cb25d2
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 success total: 0 errors, 0 warnings, 0 checks, 108 lines checked
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: Missing a blank line after declarations
  #761: FILE: net/core/pktgen.c:761:
  +               char c;
  +               if (get_user(c, &user_buffer[i]))

  WARNING: Missing a blank line after declarations
  #780: FILE: net/core/pktgen.c:780:
  +               char c;
  +               if (get_user(c, &user_buffer[i]))

  WARNING: Missing a blank line after declarations
  #806: FILE: net/core/pktgen.c:806:
  +               char c;
  +               if (get_user(c, &user_buffer[i]))

  WARNING: Missing a blank line after declarations
  #823: FILE: net/core/pktgen.c:823:
  +               char c;
  +               if (get_user(c, &user_buffer[i]))

  WARNING: Missing a blank line after declarations
  #1968: FILE: net/core/pktgen.c:1968:
  +               char f[32];
  +               memset(f, 0, 32);

  WARNING: Missing a blank line after declarations
  #2410: FILE: net/core/pktgen.c:2410:
  +       struct pktgen_net *pn = net_generic(dev_net(pkt_dev->odev), pg_net_id);
  +       if (!x) {

  WARNING: Missing a blank line after declarations
  #2442: FILE: net/core/pktgen.c:2442:
  +               __u16 t;
  +               if (pkt_dev->flags & F_QUEUE_MAP_RND) {

  WARNING: Missing a blank line after declarations
  #2523: FILE: net/core/pktgen.c:2523:
  +               unsigned int i;
  +               for (i = 0; i < pkt_dev->nr_labels; i++)

  WARNING: Missing a blank line after declarations
  #2567: FILE: net/core/pktgen.c:2567:
  +                       __u32 t;
  +                       if (pkt_dev->flags & F_IPSRC_RND)

  WARNING: Missing a blank line after declarations
  #2587: FILE: net/core/pktgen.c:2587:
  +                               __be32 s;
  +                               if (pkt_dev->flags & F_IPDST_RND) {

  WARNING: Missing a blank line after declarations
  #2634: FILE: net/core/pktgen.c:2634:
  +               __u32 t;
  +               if (pkt_dev->flags & F_TXSIZE_RND) {

  WARNING: Missing a blank line after declarations
  #2736: FILE: net/core/pktgen.c:2736:
  +               int i;
  +               for (i = 0; i < pkt_dev->cflows; i++) {

  WARNING: Missing a blank line after declarations
  #2738: FILE: net/core/pktgen.c:2738:
  +                       struct xfrm_state *x = pkt_dev->flows[i].x;
  +                       if (x) {

  WARNING: Missing a blank line after declarations
  #2752: FILE: net/core/pktgen.c:2752:
  +               int nhead = 0;
  +               if (x) {

  WARNING: Missing a blank line after declarations
  #2795: FILE: net/core/pktgen.c:2795:
  +       unsigned int i;
  +       for (i = 0; i < pkt_dev->nr_labels; i++)

  WARNING: Missing a blank line after declarations
  #3480: FILE: net/core/pktgen.c:3480:
  +       ktime_t idle_start = ktime_get();
  +       schedule();

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 net/core/pktgen.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff mbox series

Patch

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 6d2bf1ae5eb9..72063f3f8c61 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -758,6 +758,7 @@  static ssize_t hex32_arg(const char __user *user_buffer, size_t maxlen,
 	for (; i < maxlen; i++) {
 		int value;
 		char c;
+
 		if (get_user(c, &user_buffer[i]))
 			return -EFAULT;
 		value = hex_to_bin(c);
@@ -777,6 +778,7 @@  static ssize_t count_trail_chars(const char __user *user_buffer, size_t maxlen)
 
 	for (i = 0; i < maxlen; i++) {
 		char c;
+
 		if (get_user(c, &user_buffer[i]))
 			return -EFAULT;
 		switch (c) {
@@ -803,6 +805,7 @@  static ssize_t num_arg(const char __user *user_buffer, size_t maxlen,
 
 	for (i = 0; i < maxlen; i++) {
 		char c;
+
 		if (get_user(c, &user_buffer[i]))
 			return -EFAULT;
 		if ((c >= '0') && (c <= '9')) {
@@ -820,6 +823,7 @@  static ssize_t strn_len(const char __user *user_buffer, size_t maxlen)
 
 	for (i = 0; i < maxlen; i++) {
 		char c;
+
 		if (get_user(c, &user_buffer[i]))
 			return -EFAULT;
 		switch (c) {
@@ -1965,6 +1969,7 @@  static ssize_t pktgen_thread_write(struct file *file,
 
 	if (!strcmp(name, "add_device")) {
 		char f[32];
+
 		memset(f, 0, 32);
 		max = min(sizeof(f) - 1, count - i);
 		len = strn_len(&user_buffer[i], max);
@@ -2407,6 +2412,7 @@  static void get_ipsec_sa(struct pktgen_dev *pkt_dev, int flow)
 #ifdef CONFIG_XFRM
 	struct xfrm_state *x = pkt_dev->flows[flow].x;
 	struct pktgen_net *pn = net_generic(dev_net(pkt_dev->odev), pg_net_id);
+
 	if (!x) {
 
 		if (pkt_dev->spi) {
@@ -2439,6 +2445,7 @@  static void set_cur_queue_map(struct pktgen_dev *pkt_dev)
 
 	else if (pkt_dev->queue_map_min <= pkt_dev->queue_map_max) {
 		__u16 t;
+
 		if (pkt_dev->flags & F_QUEUE_MAP_RND) {
 			t = get_random_u32_inclusive(pkt_dev->queue_map_min,
 						     pkt_dev->queue_map_max);
@@ -2520,6 +2527,7 @@  static void mod_cur_headers(struct pktgen_dev *pkt_dev)
 
 	if (pkt_dev->flags & F_MPLS_RND) {
 		unsigned int i;
+
 		for (i = 0; i < pkt_dev->nr_labels; i++)
 			if (pkt_dev->labels[i] & MPLS_STACK_BOTTOM)
 				pkt_dev->labels[i] = MPLS_STACK_BOTTOM |
@@ -2564,6 +2572,7 @@  static void mod_cur_headers(struct pktgen_dev *pkt_dev)
 		imx = ntohl(pkt_dev->saddr_max);
 		if (imn < imx) {
 			__u32 t;
+
 			if (pkt_dev->flags & F_IPSRC_RND)
 				t = get_random_u32_inclusive(imn, imx - 1);
 			else {
@@ -2584,6 +2593,7 @@  static void mod_cur_headers(struct pktgen_dev *pkt_dev)
 			if (imn < imx) {
 				__u32 t;
 				__be32 s;
+
 				if (pkt_dev->flags & F_IPDST_RND) {
 
 					do {
@@ -2631,6 +2641,7 @@  static void mod_cur_headers(struct pktgen_dev *pkt_dev)
 
 	if (pkt_dev->min_pkt_size < pkt_dev->max_pkt_size) {
 		__u32 t;
+
 		if (pkt_dev->flags & F_TXSIZE_RND) {
 			t = get_random_u32_inclusive(pkt_dev->min_pkt_size,
 						     pkt_dev->max_pkt_size - 1);
@@ -2733,8 +2744,10 @@  static void free_SAs(struct pktgen_dev *pkt_dev)
 	if (pkt_dev->cflows) {
 		/* let go of the SAs if we have them */
 		int i;
+
 		for (i = 0; i < pkt_dev->cflows; i++) {
 			struct xfrm_state *x = pkt_dev->flows[i].x;
+
 			if (x) {
 				xfrm_state_put(x);
 				pkt_dev->flows[i].x = NULL;
@@ -2749,6 +2762,7 @@  static int process_ipsec(struct pktgen_dev *pkt_dev,
 	if (pkt_dev->flags & F_IPSEC) {
 		struct xfrm_state *x = pkt_dev->flows[pkt_dev->curfl].x;
 		int nhead = 0;
+
 		if (x) {
 			struct ethhdr *eth;
 			struct iphdr *iph;
@@ -2792,6 +2806,7 @@  static int process_ipsec(struct pktgen_dev *pkt_dev,
 static void mpls_push(__be32 *mpls, struct pktgen_dev *pkt_dev)
 {
 	unsigned int i;
+
 	for (i = 0; i < pkt_dev->nr_labels; i++)
 		*mpls++ = pkt_dev->labels[i] & ~MPLS_STACK_BOTTOM;
 
@@ -3477,6 +3492,7 @@  static void pktgen_rem_thread(struct pktgen_thread *t)
 static void pktgen_resched(struct pktgen_dev *pkt_dev)
 {
 	ktime_t idle_start = ktime_get();
+
 	schedule();
 	pkt_dev->idle_acc += ktime_to_ns(ktime_sub(ktime_get(), idle_start));
 }