DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 00/14] whitespace around keywords
@ 2022-11-09 19:14 Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 01/14] eal: fix whitespace Stephen Hemminger
                   ` (15 more replies)
  0 siblings, 16 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The DPDK standard now enforced through checkpatch is to use
a space after keywords. Much of the older code that was grandfathered
in doesn't follow that, so fix it.

No urgency to this patchset, and it might just be viewed as churn.
But I prefer to read code that looks all the same.

“A foolish consistency is the hobgoblin of little minds, adored by
little statesmen and philosophers and divines. With consistency a
great soul has simply nothing to do. He may as well concern himself
with his shadow on the wall."  -- Ralph Waldo Emerson

Stephen Hemminger (14):
  eal: fix whitespace
  cmdline: fix whitespace
  timer: fix whitespace
  ip_frag: fix whitespace
  testpmd: fix whitspace
  test: fix whitespace
  examples/qos_sched: fix whitespace
  examples/vhost: fix whitespace
  l3fwd: fix whitespace
  examples: fix whitespace
  bus/pci: fix whitespace
  net/e1000: fix whitespace
  net/i40e: fix whitespace
  net/bnx2x: fix whitespace

 app/test-pmd/cmdline.c                     | 30 +++++++++++-----------
 app/test-pmd/parameters.c                  |  8 +++---
 app/test-pmd/testpmd.c                     |  2 +-
 app/test/test_cmdline_cirbuf.c             |  4 +--
 app/test/test_debug.c                      |  4 +--
 app/test/test_hash.c                       |  8 +++---
 app/test/test_lpm6_perf.c                  |  2 +-
 app/test/test_malloc.c                     | 14 +++++-----
 app/test/test_mbuf.c                       | 12 ++++-----
 app/test/test_spinlock.c                   |  2 +-
 drivers/bus/pci/bsd/pci.c                  |  2 +-
 drivers/net/bnx2x/bnx2x.h                  |  2 +-
 drivers/net/e1000/em_ethdev.c              |  4 +--
 drivers/net/e1000/igb_ethdev.c             |  8 +++---
 drivers/net/i40e/i40e_pf.c                 |  8 +++---
 examples/cmdline/parse_obj_list.c          |  2 +-
 examples/ip_reassembly/main.c              |  2 +-
 examples/l3fwd-power/main.c                |  6 ++---
 examples/l3fwd/main.c                      |  6 ++---
 examples/multi_process/symmetric_mp/main.c |  6 ++---
 examples/qos_sched/app_thread.c            |  6 ++---
 examples/qos_sched/args.c                  |  2 +-
 examples/qos_sched/init.c                  |  2 +-
 examples/qos_sched/main.c                  |  4 +--
 examples/vhost/main.c                      |  6 ++---
 lib/cmdline/cmdline_parse_string.c         | 10 ++++----
 lib/cmdline/cmdline_rdline.c               |  6 ++---
 lib/eal/linux/eal_hugepage_info.c          |  6 ++---
 lib/eal/linux/eal_interrupts.c             |  2 +-
 lib/ip_frag/rte_ipv4_reassembly.c          |  2 +-
 lib/timer/rte_timer.c                      |  2 +-
 31 files changed, 90 insertions(+), 90 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 01/14] eal: fix whitespace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 02/14] cmdline: " Stephen Hemminger
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Harman Kalra

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/eal/linux/eal_hugepage_info.c | 6 +++---
 lib/eal/linux/eal_interrupts.c    | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index a1b6cb31ff1a..b6d751a2ee97 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -180,8 +180,8 @@ get_default_hp_size(void)
 	FILE *fd = fopen(proc_meminfo, "r");
 	if (fd == NULL)
 		rte_panic("Cannot open %s\n", proc_meminfo);
-	while(fgets(buffer, sizeof(buffer), fd)){
-		if (strncmp(buffer, str_hugepagesz, hugepagesz_len) == 0){
+	while (fgets(buffer, sizeof(buffer), fd)) {
+		if (strncmp(buffer, str_hugepagesz, hugepagesz_len) == 0) {
 			size = rte_str_to_size(&buffer[hugepagesz_len]);
 			break;
 		}
@@ -231,7 +231,7 @@ get_hugepage_dir(uint64_t hugepage_sz, char *hugedir, int len)
 	if (default_size == 0)
 		default_size = get_default_hp_size();
 
-	while (fgets(buf, sizeof(buf), fd)){
+	while (fgets(buf, sizeof(buf), fd)) {
 		const char *pagesz_str;
 
 		if (rte_strsplit(buf, sizeof(buf), splitstr, _FIELDNAME_MAX,
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index d52ec8eb4cd7..3be1b090be9e 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -1073,7 +1073,7 @@ eal_intr_handle_interrupts(int pfd, unsigned totalfds)
 	struct epoll_event events[totalfds];
 	int nfds = 0;
 
-	for(;;) {
+	for (;;) {
 		nfds = epoll_wait(pfd, events, totalfds,
 			EAL_INTR_EPOLL_WAIT_FOREVER);
 		/* epoll_wait fail */
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 02/14] cmdline: fix whitespace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 01/14] eal: fix whitespace Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 03/14] timer: " Stephen Hemminger
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Olivier Matz

Add space after keywords.
Remove unnecessary spaces in if expressions.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/cmdline/cmdline_parse_string.c | 10 +++++-----
 lib/cmdline/cmdline_rdline.c       |  6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/cmdline/cmdline_parse_string.c b/lib/cmdline/cmdline_parse_string.c
index d756638905a2..0b53d0c800cc 100644
--- a/lib/cmdline/cmdline_parse_string.c
+++ b/lib/cmdline/cmdline_parse_string.c
@@ -77,16 +77,16 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,
 				continue;
 			}
 
-			if ( strncmp(buf, str, token_len) ) {
+			if (strncmp(buf, str, token_len)) {
 				continue;
 			}
 
-			if ( !cmdline_isendoftoken(*(buf+token_len)) ) {
+			if (!cmdline_isendoftoken(*(buf+token_len))) {
 				continue;
 			}
 
 			break;
-		} while ( (str = get_next_token(str)) != NULL );
+		} while ( (str = get_next_token(str)) != NULL);
 
 		if (!str)
 			return -1;
@@ -108,7 +108,7 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,
 	/* unspecified string (unknown single token) */
 	else {
 		token_len = 0;
-		while(!cmdline_isendoftoken(buf[token_len]) &&
+		while (!cmdline_isendoftoken(buf[token_len]) &&
 		      token_len < (STR_TOKEN_SIZE-1))
 			token_len++;
 
@@ -149,7 +149,7 @@ int cmdline_complete_get_nb_string(cmdline_parse_token_hdr_t *tk)
 		return 0;
 
 	str = sd->str;
-	while( (str = get_next_token(str)) != NULL ) {
+	while ((str = get_next_token(str)) != NULL) {
 		ret++;
 	}
 	return ret;
diff --git a/lib/cmdline/cmdline_rdline.c b/lib/cmdline/cmdline_rdline.c
index 5cf723a0126a..28fc54cdfebf 100644
--- a/lib/cmdline/cmdline_rdline.c
+++ b/lib/cmdline/cmdline_rdline.c
@@ -301,7 +301,7 @@ rdline_char_in(struct rdline *rdl, char c)
 		/* delete 1 char from the left */
 		case CMDLINE_KEY_BKSPACE:
 		case CMDLINE_KEY_BKSPACE2:
-			if(!cirbuf_del_tail_safe(&rdl->left)) {
+			if (!cirbuf_del_tail_safe(&rdl->left)) {
 				rdline_puts(rdl, vt100_bs);
 				display_right_buffer(rdl, 1);
 			}
@@ -354,7 +354,7 @@ rdline_char_in(struct rdline *rdl, char c)
 		/* paste contents of kill buffer to the left side of caret */
 		case CMDLINE_KEY_CTRL_Y:
 			i=0;
-			while(CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
+			while (CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
 			      RDLINE_BUF_SIZE &&
 			      i < rdl->kill_size) {
 				cirbuf_add_tail(&rdl->left, rdl->kill_buf[i]);
@@ -404,7 +404,7 @@ rdline_char_in(struct rdline *rdl, char c)
 				/* add chars */
 				if (ret == RDLINE_RES_COMPLETE) {
 					i=0;
-					while(CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
+					while (CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
 					      RDLINE_BUF_SIZE &&
 					      i < tmp_size) {
 						cirbuf_add_tail(&rdl->left, tmp_buf[i]);
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 03/14] timer: fix whitespace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 01/14] eal: fix whitespace Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 02/14] cmdline: " Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 04/14] ip_frag: " Stephen Hemminger
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Erik Gabriel Carrillo

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/timer/rte_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/timer/rte_timer.c b/lib/timer/rte_timer.c
index 85d67573eb9e..9eb73f1fed13 100644
--- a/lib/timer/rte_timer.c
+++ b/lib/timer/rte_timer.c
@@ -350,7 +350,7 @@ timer_get_prev_entries(uint64_t time_val, unsigned tim_lcore,
 {
 	unsigned lvl = priv_timer[tim_lcore].curr_skiplist_depth;
 	prev[lvl] = &priv_timer[tim_lcore].pending_head;
-	while(lvl != 0) {
+	while (lvl != 0) {
 		lvl--;
 		prev[lvl] = prev[lvl+1];
 		while (prev[lvl]->sl_next[lvl] &&
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 04/14] ip_frag: fix whitespace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
                   ` (2 preceding siblings ...)
  2022-11-09 19:14 ` [PATCH 03/14] timer: " Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 05/14] testpmd: fix whitspace Stephen Hemminger
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Konstantin Ananyev

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/ip_frag/rte_ipv4_reassembly.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ip_frag/rte_ipv4_reassembly.c b/lib/ip_frag/rte_ipv4_reassembly.c
index 4a89a5f5365a..88ee0aa63f62 100644
--- a/lib/ip_frag/rte_ipv4_reassembly.c
+++ b/lib/ip_frag/rte_ipv4_reassembly.c
@@ -34,7 +34,7 @@ ipv4_frag_reassemble(struct ip_frag_pkt *fp)
 		for (i = n; i != IP_FIRST_FRAG_IDX && ofs != first_len; i--) {
 
 			/* previous fragment found. */
-			if(fp->frags[i].ofs + fp->frags[i].len == ofs) {
+			if (fp->frags[i].ofs + fp->frags[i].len == ofs) {
 
 				RTE_ASSERT(curr_idx != i);
 
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 05/14] testpmd: fix whitspace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
                   ` (3 preceding siblings ...)
  2022-11-09 19:14 ` [PATCH 04/14] ip_frag: " Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 06/14] test: fix whitespace Stephen Hemminger
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Aman Singh, Yuying Zhang

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test-pmd/cmdline.c    | 30 +++++++++++++++---------------
 app/test-pmd/parameters.c |  8 ++++----
 app/test-pmd/testpmd.c    |  2 +-
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 8dc60e938830..ff1fd1b470af 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2730,11 +2730,11 @@ parse_reta_config(const char *str,
 
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		if ((p0 = strchr(p,')')) == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
@@ -3242,15 +3242,15 @@ cmd_config_thresh_parsed(void *parsed_result,
 
 	if (!strcmp(res->name, "txpt"))
 		tx_pthresh = res->value;
-	else if(!strcmp(res->name, "txht"))
+	else if (!strcmp(res->name, "txht"))
 		tx_hthresh = res->value;
-	else if(!strcmp(res->name, "txwt"))
+	else if (!strcmp(res->name, "txwt"))
 		tx_wthresh = res->value;
-	else if(!strcmp(res->name, "rxpt"))
+	else if (!strcmp(res->name, "rxpt"))
 		rx_pthresh = res->value;
-	else if(!strcmp(res->name, "rxht"))
+	else if (!strcmp(res->name, "rxht"))
 		rx_hthresh = res->value;
-	else if(!strcmp(res->name, "rxwt"))
+	else if (!strcmp(res->name, "rxwt"))
 		rx_wthresh = res->value;
 	else {
 		fprintf(stderr, "Unknown parameter\n");
@@ -4088,8 +4088,8 @@ cmd_vlan_offload_parsed(void *parsed_result,
 	len = strnlen(str, STR_TOKEN_SIZE);
 	i = 0;
 	/* Get port_id first */
-	while(i < len){
-		if(str[i] == ',')
+	while (i < len){
+		if (str[i] == ',')
 			break;
 
 		i++;
@@ -4097,7 +4097,7 @@ cmd_vlan_offload_parsed(void *parsed_result,
 	str[i]='\0';
 	tmp = strtoul(str, NULL, 0);
 	/* If port_id greater that what portid_t can represent, return */
-	if(tmp >= RTE_MAX_ETHPORTS)
+	if (tmp >= RTE_MAX_ETHPORTS)
 		return;
 	port_id = (portid_t)tmp;
 
@@ -4108,17 +4108,17 @@ cmd_vlan_offload_parsed(void *parsed_result,
 
 	if (!strcmp(res->what, "strip"))
 		rx_vlan_strip_set(port_id,  on);
-	else if(!strcmp(res->what, "stripq")){
+	else if (!strcmp(res->what, "stripq")){
 		uint16_t queue_id = 0;
 
 		/* No queue_id, return */
-		if(i + 1 >= len) {
+		if (i + 1 >= len) {
 			fprintf(stderr, "must specify (port,queue_id)\n");
 			return;
 		}
 		tmp = strtoul(str + i + 1, NULL, 0);
 		/* If queue_id greater that what 16-bits can represent, return */
-		if(tmp > 0xffff)
+		if (tmp > 0xffff)
 			return;
 
 		queue_id = (uint16_t)tmp;
@@ -7207,7 +7207,7 @@ static void cmd_mac_addr_parsed(void *parsed_result,
 		ret = rte_eth_dev_mac_addr_remove(res->port_num, &res->address);
 
 	/* check the return value and print it if is < 0 */
-	if(ret < 0)
+	if (ret < 0)
 		fprintf(stderr, "mac_addr_cmd error: (%s)\n", strerror(-ret));
 
 }
@@ -7780,7 +7780,7 @@ static void cmd_vf_mac_addr_parsed(void *parsed_result,
 						res->vf_num);
 #endif
 
-	if(ret < 0)
+	if (ret < 0)
 		fprintf(stderr, "vf_mac_addr_cmd error: (%s)\n", strerror(-ret));
 
 }
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index aed4cdcb8485..b7372e025ffd 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -306,11 +306,11 @@ parse_portnuma_config(const char *q_arg)
 	/* reset from value set at definition */
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		if ((p0 = strchr(p,')')) == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
@@ -366,11 +366,11 @@ parse_ringnuma_config(const char *q_arg)
 	/* reset from value set at definition */
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		if ((p0 = strchr(p,')')) == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index aa7ea29f15ba..04b078a2938b 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2406,7 +2406,7 @@ start_packet_forwarding(int with_tx_first)
 
 	test_done = 0;
 
-	if(!no_flush_rx)
+	if (!no_flush_rx)
 		flush_fwd_rx_queues();
 
 	rxtx_config_display();
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 06/14] test: fix whitespace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
                   ` (4 preceding siblings ...)
  2022-11-09 19:14 ` [PATCH 05/14] testpmd: fix whitspace Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 07/14] examples/qos_sched: " Stephen Hemminger
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Olivier Matz, Yipeng Wang, Sameh Gobriel,
	Bruce Richardson, Vladimir Medvedkin, Anatoly Burakov

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/test_cmdline_cirbuf.c |  4 ++--
 app/test/test_debug.c          |  4 ++--
 app/test/test_hash.c           |  8 ++++----
 app/test/test_lpm6_perf.c      |  2 +-
 app/test/test_malloc.c         | 14 +++++++-------
 app/test/test_mbuf.c           | 12 ++++++------
 app/test/test_spinlock.c       |  2 +-
 7 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/app/test/test_cmdline_cirbuf.c b/app/test/test_cmdline_cirbuf.c
index 8ac326cb02e0..6f7aae6df59a 100644
--- a/app/test/test_cmdline_cirbuf.c
+++ b/app/test/test_cmdline_cirbuf.c
@@ -708,7 +708,7 @@ test_cirbuf_char_fill(void)
 		return -1;
 	}
 	/* delete buffer from tail */
-	for(i = 0; i < CMDLINE_TEST_BUFSIZE; i++)
+	for (i = 0; i < CMDLINE_TEST_BUFSIZE; i++)
 		cirbuf_del_tail_safe(&cb);
 	/* try to delete from an empty buffer */
 	if (cirbuf_del_tail_safe(&cb) >= 0) {
@@ -737,7 +737,7 @@ test_cirbuf_char_fill(void)
 		return -1;
 	}
 	/* delete buffer from head */
-	for(i = 0; i < CMDLINE_TEST_BUFSIZE; i++)
+	for (i = 0; i < CMDLINE_TEST_BUFSIZE; i++)
 		cirbuf_del_head_safe(&cb);
 	/* try to delete from an empty buffer */
 	if (cirbuf_del_head_safe(&cb) >= 0) {
diff --git a/app/test/test_debug.c b/app/test/test_debug.c
index 2704f5b92726..c66748019d9f 100644
--- a/app/test/test_debug.c
+++ b/app/test/test_debug.c
@@ -53,7 +53,7 @@ test_panic(void)
 		return -1;
 	}
 	wait(&status);
-	if(status == 0){
+	if (status == 0){
 		printf("Child process terminated normally!\n");
 		return -1;
 	} else
@@ -84,7 +84,7 @@ test_exit_val(int exit_val)
 	}
 	wait(&status);
 	printf("Child process status: %d\n", status);
-	if(!WIFEXITED(status) || WEXITSTATUS(status) != (uint8_t)exit_val){
+	if (!WIFEXITED(status) || WEXITSTATUS(status) != (uint8_t)exit_val){
 		printf("Child process terminated with incorrect status (expected = %d)!\n",
 				exit_val);
 		return -1;
diff --git a/app/test/test_hash.c b/app/test/test_hash.c
index 3e45afaa67fc..5e0618f0c340 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -72,7 +72,7 @@ static uint32_t hashtest_key_lens[] = {0, 2, 4, 5, 6, 7, 8, 10, 11, 15, 16, 21,
 		rte_free(g_qsv);					\
 		return -1;						\
 	}								\
-} while (0)
+} while(0)
 
 /*
  * 5-tuple key type.
@@ -724,12 +724,12 @@ static int test_five_keys(void)
 	}
 
 	/* Lookup */
-	for(i = 0; i < 5; i++)
+	for (i = 0; i < 5; i++)
 		key_array[i] = &keys[i];
 
 	ret = rte_hash_lookup_bulk(handle, &key_array[0], 5, (int32_t *)pos);
-	if(ret == 0)
-		for(i = 0; i < 5; i++) {
+	if (ret == 0)
+		for (i = 0; i < 5; i++) {
 			print_key_info("Lkp", key_array[i], pos[i]);
 			RETURN_IF_ERROR(pos[i] != expected_pos[i],
 					"failed to find key (pos[%u]=%d)", i, pos[i]);
diff --git a/app/test/test_lpm6_perf.c b/app/test/test_lpm6_perf.c
index aaf2773b6fac..2f9321345e4b 100644
--- a/app/test/test_lpm6_perf.c
+++ b/app/test/test_lpm6_perf.c
@@ -47,7 +47,7 @@ print_route_distribution(const struct rules_tbl_entry *table, uint32_t n)
 	printf("--------------------------- \n");
 
 	/* Count depths. */
-	for(i = 1; i <= 128; i++) {
+	for (i = 1; i <= 128; i++) {
 		unsigned depth_counter = 0;
 		double percent_hits;
 
diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c
index de40e506113a..0bb18c8cf7aa 100644
--- a/app/test/test_malloc.c
+++ b/app/test/test_malloc.c
@@ -86,8 +86,8 @@ test_align_overlap_per_lcore(__rte_unused void *arg)
 			ret = -1;
 			break;
 		}
-		for(j = 0; j < 1000 ; j++) {
-			if( *(char *)p1 != 0) {
+		for (j = 0; j < 1000 ; j++) {
+			if ( *(char *)p1 != 0) {
 				printf("rte_zmalloc didn't zero the allocated memory\n");
 				ret = -1;
 			}
@@ -157,8 +157,8 @@ test_reordered_free_per_lcore(__rte_unused void *arg)
 			ret = -1;
 			break;
 		}
-		for(j = 0; j < 1000 ; j++) {
-			if( *(char *)p1 != 0) {
+		for (j = 0; j < 1000 ; j++) {
+			if ( *(char *)p1 != 0) {
 				printf("rte_zmalloc didn't zero the allocated memory\n");
 				ret = -1;
 			}
@@ -331,12 +331,12 @@ test_multi_alloc_statistics(void)
 	/* After freeing both allocations check stats return to original */
 	rte_malloc_get_socket_stats(socket, &post_stats);
 
-	if(second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) {
+	if (second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) {
 		printf("Incorrect heap statistics: Total size \n");
 		return -1;
 	}
 	/* Check allocated size is equal to two additions plus overhead */
-	if(second_stats.heap_allocsz_bytes !=
+	if (second_stats.heap_allocsz_bytes !=
 			size + overhead + first_stats.heap_allocsz_bytes) {
 		printf("Incorrect heap statistics: Allocated size \n");
 		return -1;
@@ -495,7 +495,7 @@ test_realloc_socket(int socket)
 		return -1;
 	}
 	/* calc an alignment we don't already have */
-	while(RTE_PTR_ALIGN(ptr7, new_align) == ptr7)
+	while (RTE_PTR_ALIGN(ptr7, new_align) == ptr7)
 		new_align *= 2;
 	char *ptr8 = rte_realloc_socket(ptr7, size7, new_align, socket);
 	if (!ptr8){
diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 53fe898a384c..d505fd25e022 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -120,7 +120,7 @@ static unsigned refcnt_lcore[RTE_MAX_LCORE];
 		printf("mbuf test FAILED (l.%d): <" str ">\n",		\
 		       __LINE__,  ##__VA_ARGS__);			\
 		goto fail;						\
-} while(0)
+} while (0)
 
 /*
  * test data manipulation in mbuf with non-ascii data
@@ -154,7 +154,7 @@ test_pktmbuf_with_non_ascii_data(struct rte_mempool *pktmbuf_pool)
 	return 0;
 
 fail:
-	if(m) {
+	if (m) {
 		rte_pktmbuf_free(m);
 	}
 	return -1;
@@ -701,12 +701,12 @@ test_pktmbuf_pool(struct rte_mempool *pktmbuf_pool)
 	}
 	struct rte_mbuf *extra = NULL;
 	extra = rte_pktmbuf_alloc(pktmbuf_pool);
-	if(extra != NULL) {
+	if (extra != NULL) {
 		printf("Error pool not empty");
 		ret = -1;
 	}
 	extra = rte_pktmbuf_clone(m[0], pktmbuf_pool);
-	if(extra != NULL) {
+	if (extra != NULL) {
 		printf("Error pool not empty");
 		ret = -1;
 	}
@@ -966,7 +966,7 @@ test_pktmbuf_free_segment(struct rte_mempool *pktmbuf_pool)
 			struct rte_mbuf *mb, *mt;
 
 			mb = m[i];
-			while(mb != NULL) {
+			while (mb != NULL) {
 				mt = mb;
 				mb = mb->next;
 				rte_pktmbuf_free_seg(mt);
@@ -1195,7 +1195,7 @@ verify_mbuf_check_panics(struct rte_mbuf *buf)
 		return -1;
 	}
 	wait(&status);
-	if(status == 0)
+	if (status == 0)
 		return -1;
 
 	return 0;
diff --git a/app/test/test_spinlock.c b/app/test/test_spinlock.c
index 3f59372300c3..3ee82fa963a5 100644
--- a/app/test/test_spinlock.c
+++ b/app/test/test_spinlock.c
@@ -237,7 +237,7 @@ test_spinlock(void)
 	/*
 	 * Try to acquire a lock that we already own
 	 */
-	if(!rte_spinlock_recursive_trylock(&slr)) {
+	if (!rte_spinlock_recursive_trylock(&slr)) {
 		printf("rte_spinlock_recursive_trylock failed on a lock that "
 		       "we already own\n");
 		ret = -1;
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 07/14] examples/qos_sched: fix whitespace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
                   ` (5 preceding siblings ...)
  2022-11-09 19:14 ` [PATCH 06/14] test: fix whitespace Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:28   ` Dumitrescu, Cristian
  2022-11-09 19:14 ` [PATCH 08/14] examples/vhost: " Stephen Hemminger
                   ` (8 subsequent siblings)
  15 siblings, 1 reply; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Cristian Dumitrescu

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/qos_sched/app_thread.c | 6 +++---
 examples/qos_sched/args.c       | 2 +-
 examples/qos_sched/init.c       | 2 +-
 examples/qos_sched/main.c       | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/examples/qos_sched/app_thread.c b/examples/qos_sched/app_thread.c
index dbc878b55394..a49356fecf5f 100644
--- a/examples/qos_sched/app_thread.c
+++ b/examples/qos_sched/app_thread.c
@@ -79,7 +79,7 @@ app_rx_thread(struct thread_conf **confs)
 		if (likely(nb_rx != 0)) {
 			APP_STATS_ADD(conf->stat.nb_rx, nb_rx);
 
-			for(i = 0; i < nb_rx; i++) {
+			for (i = 0; i < nb_rx; i++) {
 				get_pkt_sched(rx_mbufs[i],
 						&subport, &pipe, &traffic_class, &queue, &color);
 				rte_sched_port_pkt_write(conf->sched_port,
@@ -91,7 +91,7 @@ app_rx_thread(struct thread_conf **confs)
 
 			if (unlikely(rte_ring_sp_enqueue_bulk(conf->rx_ring,
 					(void **)rx_mbufs, nb_rx, NULL) == 0)) {
-				for(i = 0; i < nb_rx; i++) {
+				for (i = 0; i < nb_rx; i++) {
 					rte_pktmbuf_free(rx_mbufs[i]);
 
 					APP_STATS_ADD(conf->stat.nb_drop, 1);
@@ -137,7 +137,7 @@ app_send_packets(struct thread_conf *qconf, struct rte_mbuf **mbufs, uint32_t nb
 	uint32_t i, len;
 
 	len = qconf->n_mbufs;
-	for(i = 0; i < nb_pkt; i++) {
+	for (i = 0; i < nb_pkt; i++) {
 		qconf->m_table[len] = mbufs[i];
 		len++;
 		/* enough pkts to be sent */
diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
index b2959499ae9a..b752eb221f7c 100644
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -451,7 +451,7 @@ app_parse_args(int argc, char **argv)
 	/* sanity check for cores assignment */
 	nb_lcores = app_cpu_core_count();
 
-	for(i = 0; i < nb_pfc; i++) {
+	for (i = 0; i < nb_pfc; i++) {
 		if (qos_conf[i].rx_core >= nb_lcores) {
 			RTE_LOG(ERR, APP, "pfc %u: invalid RX lcore index %u\n", i + 1,
 					qos_conf[i].rx_core);
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 0709aec10c31..41b46b296298 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -323,7 +323,7 @@ int app_init(void)
 		rte_exit(EXIT_FAILURE, "Invalid configuration profile\n");
 
 	/* Initialize each active flow */
-	for(i = 0; i < nb_pfc; i++) {
+	for (i = 0; i < nb_pfc; i++) {
 		uint32_t socket = rte_lcore_to_socket_id(qos_conf[i].rx_core);
 		struct rte_ring *ring;
 
diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c
index dc6a17a6464a..7b757df0eb02 100644
--- a/examples/qos_sched/main.c
+++ b/examples/qos_sched/main.c
@@ -152,7 +152,7 @@ app_stat(void)
 	static struct rte_eth_stats tx_stats[MAX_DATA_STREAMS];
 
 	/* print statistics */
-	for(i = 0; i < nb_pfc; i++) {
+	for (i = 0; i < nb_pfc; i++) {
 		struct flow_conf *flow = &qos_conf[i];
 
 		rte_eth_stats_get(flow->rx_port, &stats);
@@ -212,7 +212,7 @@ main(int argc, char **argv)
 	}
 	else {
 		/* print statistics every second */
-		while(1) {
+		while (1) {
 			sleep(1);
 			app_stat();
 		}
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 08/14] examples/vhost: fix whitespace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
                   ` (6 preceding siblings ...)
  2022-11-09 19:14 ` [PATCH 07/14] examples/qos_sched: " Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 09/14] l3fwd: " Stephen Hemminger
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Maxime Coquelin, Chenbo Xia

Add space after keywords

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/vhost/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 42e53a0f9a4f..cabc8682346c 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1491,7 +1491,7 @@ switch_worker(void *arg __rte_unused)
 		}
 	}
 
-	while(1) {
+	while (1) {
 		drain_mbuf_table(tx_q);
 		drain_vhost_table();
 		/*
@@ -1583,7 +1583,7 @@ destroy_device(int vid)
 		return;
 	/*set the remove flag. */
 	vdev->remove = 1;
-	while(vdev->ready != DEVICE_SAFE_REMOVE) {
+	while (vdev->ready != DEVICE_SAFE_REMOVE) {
 		rte_pause();
 	}
 
@@ -1816,7 +1816,7 @@ print_stats(__rte_unused void *arg)
 	const char clr[] = { 27, '[', '2', 'J', '\0' };
 	const char top_left[] = { 27, '[', '1', ';', '1', 'H','\0' };
 
-	while(1) {
+	while (1) {
 		sleep(enable_stats);
 
 		/* Clear screen and move to top left */
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 09/14] l3fwd: fix whitespace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
                   ` (7 preceding siblings ...)
  2022-11-09 19:14 ` [PATCH 08/14] examples/vhost: " Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 10/14] examples: " Stephen Hemminger
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, David Hunt

Add space after keywoords

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/l3fwd-power/main.c | 6 +++---
 examples/l3fwd/main.c       | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd3ade330f82..b2270e1056c8 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1787,11 +1787,11 @@ parse_config(const char *q_arg)
 
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		if ((p0 = strchr(p,')')) == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
@@ -2946,7 +2946,7 @@ main(int argc, char **argv)
 		fflush(stdout);
 
 		/* init RX queues */
-		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+		for (queue = 0; queue < qconf->n_rx_queue; ++queue) {
 			struct rte_eth_rxconf rxq_conf;
 
 			portid = qconf->rx_queue_list[queue].port_id;
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 5198ff30dd00..2e1c4939f992 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -516,11 +516,11 @@ parse_config(const char *q_arg)
 
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		if ((p0 = strchr(p,')')) == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
@@ -1366,7 +1366,7 @@ l3fwd_poll_resource_setup(void)
 		printf("\nInitializing rx queues on lcore %u ... ", lcore_id );
 		fflush(stdout);
 		/* init RX queues */
-		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+		for (queue = 0; queue < qconf->n_rx_queue; ++queue) {
 			struct rte_eth_rxconf rxq_conf;
 
 			portid = qconf->rx_queue_list[queue].port_id;
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 10/14] examples: fix whitespace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
                   ` (8 preceding siblings ...)
  2022-11-09 19:14 ` [PATCH 09/14] l3fwd: " Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 11/14] bus/pci: " Stephen Hemminger
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Olivier Matz, Konstantin Ananyev, Anatoly Burakov

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/cmdline/parse_obj_list.c          | 2 +-
 examples/ip_reassembly/main.c              | 2 +-
 examples/multi_process/symmetric_mp/main.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/examples/cmdline/parse_obj_list.c b/examples/cmdline/parse_obj_list.c
index 959bcd14527e..759072d39620 100644
--- a/examples/cmdline/parse_obj_list.c
+++ b/examples/cmdline/parse_obj_list.c
@@ -42,7 +42,7 @@ parse_obj_list(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,
 	if (res && ressize < sizeof(struct object *))
 		return -1;
 
-	while(!cmdline_isendoftoken(buf[token_len]))
+	while (!cmdline_isendoftoken(buf[token_len]))
 		token_len++;
 
 	SLIST_FOREACH(o, tkd->list, next) {
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index bd0b1d31decf..7e84b4944759 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -300,7 +300,7 @@ send_single_packet(struct rte_mbuf *m, uint16_t port)
 
 	TX_LCORE_STAT_UPDATE(&qconf->tx_stat, queue, 1);
 	txmb->m_table[txmb->head] = m;
-	if(++txmb->head == len)
+	if (++txmb->head == len)
 		txmb->head = 0;
 
 	return 0;
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 1ff85875dfdf..9c5348bd36ed 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -156,7 +156,7 @@ smp_parse_args(int argc, char **argv)
 
 	/* get the port numbers from the port mask */
 	RTE_ETH_FOREACH_DEV(i)
-		if(port_mask & (1 << i))
+		if (port_mask & (1 << i))
 			ports[num_ports++] = (uint8_t)i;
 
 	ret = optind-1;
@@ -470,8 +470,8 @@ main(int argc, char **argv)
 	/* Primary instance initialized. 8< */
 	if (num_ports & 1)
 		rte_exit(EXIT_FAILURE, "Application must use an even number of ports\n");
-	for(i = 0; i < num_ports; i++){
-		if(proc_type == RTE_PROC_PRIMARY)
+	for (i = 0; i < num_ports; i++){
+		if (proc_type == RTE_PROC_PRIMARY)
 			if (smp_port_init(ports[i], mp, (uint16_t)num_procs) < 0)
 				rte_exit(EXIT_FAILURE, "Error initialising ports\n");
 	}
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 11/14] bus/pci: fix whitespace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
                   ` (9 preceding siblings ...)
  2022-11-09 19:14 ` [PATCH 10/14] examples: " Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 12/14] net/e1000: " Stephen Hemminger
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/pci/bsd/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c
index 7459d15c7e31..056e2eda2d5f 100644
--- a/drivers/bus/pci/bsd/pci.c
+++ b/drivers/bus/pci/bsd/pci.c
@@ -368,7 +368,7 @@ rte_pci_scan(void)
 		}
 
 		dev_count += conf_io.num_matches;
-	} while(conf_io.status == PCI_GETCONF_MORE_DEVS);
+	} while (conf_io.status == PCI_GETCONF_MORE_DEVS);
 
 	close(fd);
 
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 12/14] net/e1000: fix whitespace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
                   ` (10 preceding siblings ...)
  2022-11-09 19:14 ` [PATCH 11/14] bus/pci: " Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 13/14] net/i40e: " Stephen Hemminger
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Simei Su, Wenjun Wu

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/e1000/em_ethdev.c  | 4 ++--
 drivers/net/e1000/igb_ethdev.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 8ee9be12ad19..146e74cfc76e 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -872,8 +872,8 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)
 			E1000_DEV_PRIVATE_TO_STATS(dev->data->dev_private);
 	int pause_frames;
 
-	if(hw->phy.media_type == e1000_media_type_copper ||
-			(E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) {
+	if (hw->phy.media_type == e1000_media_type_copper ||
+	    (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) {
 		stats->symerrs += E1000_READ_REG(hw,E1000_SYMERRS);
 		stats->sec += E1000_READ_REG(hw, E1000_SEC);
 	}
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 8858f975f8cc..5c35b8349063 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -1683,7 +1683,7 @@ igb_read_stats_registers(struct e1000_hw *hw, struct e1000_hw_stats *stats)
 	uint64_t old_rpthc = stats->rpthc;
 	uint64_t old_hgptc = stats->hgptc;
 
-	if(hw->phy.media_type == e1000_media_type_copper ||
+	if (hw->phy.media_type == e1000_media_type_copper ||
 	    (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) {
 		stats->symerrs +=
 		    E1000_READ_REG(hw,E1000_SYMERRS);
@@ -3500,10 +3500,10 @@ static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on)
 
 	for (i = 0; i < IGB_VFTA_SIZE; i++){
 		vfta = shadow_vfta->vfta[i];
-		if(vfta){
+		if (vfta){
 			mask = 1;
 			for (j = 0; j < 32; j++){
-				if(vfta & mask)
+				if (vfta & mask)
 					igbvf_set_vfta(hw,
 						(uint16_t)((i<<5)+j), on);
 				mask<<=1;
@@ -3528,7 +3528,7 @@ igbvf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 
 	/*vind is not used in VF driver, set to 0, check ixgbe_set_vfta_vf*/
 	ret = igbvf_set_vfta(hw, vlan_id, !!on);
-	if(ret){
+	if (ret){
 		PMD_INIT_LOG(ERR, "Unable to set VF vlan");
 		return ret;
 	}
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 13/14] net/i40e: fix whitespace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
                   ` (11 preceding siblings ...)
  2022-11-09 19:14 ` [PATCH 12/14] net/e1000: " Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:14 ` [PATCH 14/14] net/bnx2x: " Stephen Hemminger
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Yuying Zhang, Beilei Xing

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/i40e/i40e_pf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 15d9ff868f3a..7050e0057d8e 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -956,7 +956,7 @@ i40e_pf_host_process_cmd_add_vlan(struct i40e_pf_vf *vf,
 
 	for (i = 0; i < vlan_filter_list->num_elements; i++) {
 		ret = i40e_vsi_add_vlan(vf->vsi, vid[i]);
-		if(ret != I40E_SUCCESS)
+		if (ret != I40E_SUCCESS)
 			goto send_msg;
 	}
 
@@ -996,7 +996,7 @@ i40e_pf_host_process_cmd_del_vlan(struct i40e_pf_vf *vf,
 	vid = vlan_filter_list->vlan_id;
 	for (i = 0; i < vlan_filter_list->num_elements; i++) {
 		ret = i40e_vsi_delete_vlan(vf->vsi, vid[i]);
-		if(ret != I40E_SUCCESS)
+		if (ret != I40E_SUCCESS)
 			goto send_msg;
 	}
 
@@ -1577,12 +1577,12 @@ i40e_pf_host_init(struct rte_eth_dev *dev)
 	 * return if SRIOV not enabled, VF number not configured or
 	 * no queue assigned.
 	 */
-	if(!hw->func_caps.sr_iov_1_1 || pf->vf_num == 0 || pf->vf_nb_qps == 0)
+	if (!hw->func_caps.sr_iov_1_1 || pf->vf_num == 0 || pf->vf_nb_qps == 0)
 		return I40E_SUCCESS;
 
 	/* Allocate memory to store VF structure */
 	pf->vfs = rte_zmalloc("i40e_pf_vf",sizeof(*pf->vfs) * pf->vf_num, 0);
-	if(pf->vfs == NULL)
+	if (pf->vfs == NULL)
 		return -ENOMEM;
 
 	/* Disable irq0 for VFR event */
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 14/14] net/bnx2x: fix whitespace
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
                   ` (12 preceding siblings ...)
  2022-11-09 19:14 ` [PATCH 13/14] net/i40e: " Stephen Hemminger
@ 2022-11-09 19:14 ` Stephen Hemminger
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
  15 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Rasesh Mody, Shahed Shaikh

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bnx2x/bnx2x.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 89414ac88a93..9cb927e25449 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -96,7 +96,7 @@ int bnx2x_ilog2(int x)
 	int log = 0;
 	x >>= 1;
 
-	while(x) {
+	while (x) {
 		log++;
 		x >>= 1;
 	}
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* RE: [PATCH 07/14] examples/qos_sched: fix whitespace
  2022-11-09 19:14 ` [PATCH 07/14] examples/qos_sched: " Stephen Hemminger
@ 2022-11-09 19:28   ` Dumitrescu, Cristian
  0 siblings, 0 replies; 52+ messages in thread
From: Dumitrescu, Cristian @ 2022-11-09 19:28 UTC (permalink / raw)
  To: Stephen Hemminger, dev



> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Wednesday, November 9, 2022 7:15 PM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Dumitrescu,
> Cristian <cristian.dumitrescu@intel.com>
> Subject: [PATCH 07/14] examples/qos_sched: fix whitespace
> 
> Add space after keywords.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  examples/qos_sched/app_thread.c | 6 +++---
>  examples/qos_sched/args.c       | 2 +-
>  examples/qos_sched/init.c       | 2 +-
>  examples/qos_sched/main.c       | 4 ++--
>  4 files changed, 7 insertions(+), 7 deletions(-)
> 

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 00/14] whitespace after keywords
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
                   ` (13 preceding siblings ...)
  2022-11-09 19:14 ` [PATCH 14/14] net/bnx2x: " Stephen Hemminger
@ 2022-11-09 19:53 ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 01/14] eal: fix whitespace Stephen Hemminger
                     ` (13 more replies)
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
  15 siblings, 14 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The DPDK standard now enforced through checkpatch is to use
a space after keywords. Much of the older code that was grandfathered
in doesn't follow that, so fix it.

No urgency to this patchset, and it might just be viewed as churn.
But I prefer to read code that looks all the same.

“A foolish consistency is the hobgoblin of little minds, adored by
little statesmen and philosophers and divines. With consistency a
great soul has simply nothing to do. He may as well concern himself
with his shadow on the wall."  -- Ralph Waldo Emerson

v2 - fix related complaints from checkpatch
     if you touch a line, then it wants to make all the rules apply.

Stephen Hemminger (14):
  eal: fix whitespace
  cmdline: fix whitespace
  timer: fix whitespace
  ip_frag: fix whitespace
  testpmd: fix whitespace
  test: fix whitespace
  examples/qos_sched: fix whitespace
  examples/vhost: fix whitespace
  l3fwd: fix whitespace
  examples: fix whitespace
  bus/pci: fix whitespace
  net/e1000: fix whitespace
  net/i40e: fix whitespace
  net/bnx2x: fix whitespace

 app/test-pmd/cmdline.c                     | 31 +++++++++++-----------
 app/test-pmd/parameters.c                  | 10 ++++---
 app/test-pmd/testpmd.c                     |  2 +-
 app/test/test_cmdline_cirbuf.c             |  4 +--
 app/test/test_debug.c                      |  4 +--
 app/test/test_hash.c                       |  6 ++---
 app/test/test_lpm6_perf.c                  |  2 +-
 app/test/test_malloc.c                     | 14 +++++-----
 app/test/test_mbuf.c                       | 14 +++++-----
 app/test/test_spinlock.c                   |  2 +-
 drivers/bus/pci/bsd/pci.c                  |  2 +-
 drivers/net/bnx2x/bnx2x.h                  |  2 +-
 drivers/net/e1000/em_ethdev.c              |  4 +--
 drivers/net/e1000/igb_ethdev.c             |  8 +++---
 drivers/net/i40e/i40e_pf.c                 |  8 +++---
 examples/cmdline/parse_obj_list.c          |  2 +-
 examples/ip_reassembly/main.c              |  2 +-
 examples/l3fwd-power/main.c                |  7 ++---
 examples/l3fwd/main.c                      |  7 ++---
 examples/multi_process/symmetric_mp/main.c |  6 ++---
 examples/qos_sched/app_thread.c            |  6 ++---
 examples/qos_sched/args.c                  |  2 +-
 examples/qos_sched/init.c                  |  2 +-
 examples/qos_sched/main.c                  |  4 +--
 examples/vhost/main.c                      |  7 +++--
 lib/cmdline/cmdline_parse_string.c         | 16 +++++------
 lib/cmdline/cmdline_rdline.c               | 12 ++++-----
 lib/eal/linux/eal_hugepage_info.c          |  6 ++---
 lib/eal/linux/eal_interrupts.c             |  2 +-
 lib/ip_frag/rte_ipv4_reassembly.c          |  2 +-
 lib/timer/rte_timer.c                      |  2 +-
 31 files changed, 99 insertions(+), 99 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 01/14] eal: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 02/14] cmdline: " Stephen Hemminger
                     ` (12 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Harman Kalra

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/eal/linux/eal_hugepage_info.c | 6 +++---
 lib/eal/linux/eal_interrupts.c    | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index a1b6cb31ff1a..b6d751a2ee97 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -180,8 +180,8 @@ get_default_hp_size(void)
 	FILE *fd = fopen(proc_meminfo, "r");
 	if (fd == NULL)
 		rte_panic("Cannot open %s\n", proc_meminfo);
-	while(fgets(buffer, sizeof(buffer), fd)){
-		if (strncmp(buffer, str_hugepagesz, hugepagesz_len) == 0){
+	while (fgets(buffer, sizeof(buffer), fd)) {
+		if (strncmp(buffer, str_hugepagesz, hugepagesz_len) == 0) {
 			size = rte_str_to_size(&buffer[hugepagesz_len]);
 			break;
 		}
@@ -231,7 +231,7 @@ get_hugepage_dir(uint64_t hugepage_sz, char *hugedir, int len)
 	if (default_size == 0)
 		default_size = get_default_hp_size();
 
-	while (fgets(buf, sizeof(buf), fd)){
+	while (fgets(buf, sizeof(buf), fd)) {
 		const char *pagesz_str;
 
 		if (rte_strsplit(buf, sizeof(buf), splitstr, _FIELDNAME_MAX,
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index d52ec8eb4cd7..3be1b090be9e 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -1073,7 +1073,7 @@ eal_intr_handle_interrupts(int pfd, unsigned totalfds)
 	struct epoll_event events[totalfds];
 	int nfds = 0;
 
-	for(;;) {
+	for (;;) {
 		nfds = epoll_wait(pfd, events, totalfds,
 			EAL_INTR_EPOLL_WAIT_FOREVER);
 		/* epoll_wait fail */
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 02/14] cmdline: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 01/14] eal: fix whitespace Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 03/14] timer: " Stephen Hemminger
                     ` (11 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Olivier Matz

Add space after keywords.
Remove unnecessary spaces in if expressions.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/cmdline/cmdline_parse_string.c | 16 +++++++---------
 lib/cmdline/cmdline_rdline.c       | 12 ++++++------
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/lib/cmdline/cmdline_parse_string.c b/lib/cmdline/cmdline_parse_string.c
index d756638905a2..ab1ef4b22e40 100644
--- a/lib/cmdline/cmdline_parse_string.c
+++ b/lib/cmdline/cmdline_parse_string.c
@@ -73,20 +73,18 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,
 			token_len = get_token_len(str);
 
 			/* if token is too big... */
-			if (token_len >= STR_TOKEN_SIZE - 1) {
+			if (token_len >= STR_TOKEN_SIZE - 1)
 				continue;
 			}
 
-			if ( strncmp(buf, str, token_len) ) {
+			if (strncmp(buf, str, token_len))
 				continue;
-			}
 
-			if ( !cmdline_isendoftoken(*(buf+token_len)) ) {
+			if (!cmdline_isendoftoken(*(buf+token_len)))
 				continue;
-			}
 
 			break;
-		} while ( (str = get_next_token(str)) != NULL );
+		} while ((str = get_next_token(str)) != NULL);
 
 		if (!str)
 			return -1;
@@ -108,7 +106,7 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,
 	/* unspecified string (unknown single token) */
 	else {
 		token_len = 0;
-		while(!cmdline_isendoftoken(buf[token_len]) &&
+		while (!cmdline_isendoftoken(buf[token_len]) &&
 		      token_len < (STR_TOKEN_SIZE-1))
 			token_len++;
 
@@ -149,9 +147,9 @@ int cmdline_complete_get_nb_string(cmdline_parse_token_hdr_t *tk)
 		return 0;
 
 	str = sd->str;
-	while( (str = get_next_token(str)) != NULL ) {
+	while ((str = get_next_token(str)) != NULL)
 		ret++;
-	}
+
 	return ret;
 }
 
diff --git a/lib/cmdline/cmdline_rdline.c b/lib/cmdline/cmdline_rdline.c
index 5cf723a0126a..b5927879d48f 100644
--- a/lib/cmdline/cmdline_rdline.c
+++ b/lib/cmdline/cmdline_rdline.c
@@ -301,7 +301,7 @@ rdline_char_in(struct rdline *rdl, char c)
 		/* delete 1 char from the left */
 		case CMDLINE_KEY_BKSPACE:
 		case CMDLINE_KEY_BKSPACE2:
-			if(!cirbuf_del_tail_safe(&rdl->left)) {
+			if (!cirbuf_del_tail_safe(&rdl->left)) {
 				rdline_puts(rdl, vt100_bs);
 				display_right_buffer(rdl, 1);
 			}
@@ -354,7 +354,7 @@ rdline_char_in(struct rdline *rdl, char c)
 		/* paste contents of kill buffer to the left side of caret */
 		case CMDLINE_KEY_CTRL_Y:
 			i=0;
-			while(CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
+			while (CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
 			      RDLINE_BUF_SIZE &&
 			      i < rdl->kill_size) {
 				cirbuf_add_tail(&rdl->left, rdl->kill_buf[i]);
@@ -403,10 +403,10 @@ rdline_char_in(struct rdline *rdl, char c)
 				tmp_size = strnlen(tmp_buf, sizeof(tmp_buf));
 				/* add chars */
 				if (ret == RDLINE_RES_COMPLETE) {
-					i=0;
-					while(CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
-					      RDLINE_BUF_SIZE &&
-					      i < tmp_size) {
+					i = 0;
+					while (CIRBUF_GET_LEN(&rdl->right) +
+					       CIRBUF_GET_LEN(&rdl->left) <
+					       RDLINE_BUF_SIZE && i < tmp_size) {
 						cirbuf_add_tail(&rdl->left, tmp_buf[i]);
 						rdl->write_char(rdl, tmp_buf[i]);
 						i++;
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 03/14] timer: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 01/14] eal: fix whitespace Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 02/14] cmdline: " Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 04/14] ip_frag: " Stephen Hemminger
                     ` (10 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Erik Gabriel Carrillo

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/timer/rte_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/timer/rte_timer.c b/lib/timer/rte_timer.c
index 85d67573eb9e..9eb73f1fed13 100644
--- a/lib/timer/rte_timer.c
+++ b/lib/timer/rte_timer.c
@@ -350,7 +350,7 @@ timer_get_prev_entries(uint64_t time_val, unsigned tim_lcore,
 {
 	unsigned lvl = priv_timer[tim_lcore].curr_skiplist_depth;
 	prev[lvl] = &priv_timer[tim_lcore].pending_head;
-	while(lvl != 0) {
+	while (lvl != 0) {
 		lvl--;
 		prev[lvl] = prev[lvl+1];
 		while (prev[lvl]->sl_next[lvl] &&
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 04/14] ip_frag: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
                     ` (2 preceding siblings ...)
  2022-11-09 19:53   ` [PATCH v2 03/14] timer: " Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 05/14] testpmd: " Stephen Hemminger
                     ` (9 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Konstantin Ananyev

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/ip_frag/rte_ipv4_reassembly.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ip_frag/rte_ipv4_reassembly.c b/lib/ip_frag/rte_ipv4_reassembly.c
index 4a89a5f5365a..88ee0aa63f62 100644
--- a/lib/ip_frag/rte_ipv4_reassembly.c
+++ b/lib/ip_frag/rte_ipv4_reassembly.c
@@ -34,7 +34,7 @@ ipv4_frag_reassemble(struct ip_frag_pkt *fp)
 		for (i = n; i != IP_FIRST_FRAG_IDX && ofs != first_len; i--) {
 
 			/* previous fragment found. */
-			if(fp->frags[i].ofs + fp->frags[i].len == ofs) {
+			if (fp->frags[i].ofs + fp->frags[i].len == ofs) {
 
 				RTE_ASSERT(curr_idx != i);
 
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 05/14] testpmd: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
                     ` (3 preceding siblings ...)
  2022-11-09 19:53   ` [PATCH v2 04/14] ip_frag: " Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 06/14] test: " Stephen Hemminger
                     ` (8 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Aman Singh, Yuying Zhang

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test-pmd/cmdline.c    | 31 ++++++++++++++++---------------
 app/test-pmd/parameters.c | 10 ++++++----
 app/test-pmd/testpmd.c    |  2 +-
 3 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 8dc60e938830..7721006cc310 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2730,11 +2730,12 @@ parse_reta_config(const char *str,
 
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		p0 = strchr(p, ')');
+		if (p0 == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
@@ -3242,15 +3243,15 @@ cmd_config_thresh_parsed(void *parsed_result,
 
 	if (!strcmp(res->name, "txpt"))
 		tx_pthresh = res->value;
-	else if(!strcmp(res->name, "txht"))
+	else if (!strcmp(res->name, "txht"))
 		tx_hthresh = res->value;
-	else if(!strcmp(res->name, "txwt"))
+	else if (!strcmp(res->name, "txwt"))
 		tx_wthresh = res->value;
-	else if(!strcmp(res->name, "rxpt"))
+	else if (!strcmp(res->name, "rxpt"))
 		rx_pthresh = res->value;
-	else if(!strcmp(res->name, "rxht"))
+	else if (!strcmp(res->name, "rxht"))
 		rx_hthresh = res->value;
-	else if(!strcmp(res->name, "rxwt"))
+	else if (!strcmp(res->name, "rxwt"))
 		rx_wthresh = res->value;
 	else {
 		fprintf(stderr, "Unknown parameter\n");
@@ -4088,8 +4089,8 @@ cmd_vlan_offload_parsed(void *parsed_result,
 	len = strnlen(str, STR_TOKEN_SIZE);
 	i = 0;
 	/* Get port_id first */
-	while(i < len){
-		if(str[i] == ',')
+	while (i < len) {
+		if (str[i] == ',')
 			break;
 
 		i++;
@@ -4097,7 +4098,7 @@ cmd_vlan_offload_parsed(void *parsed_result,
 	str[i]='\0';
 	tmp = strtoul(str, NULL, 0);
 	/* If port_id greater that what portid_t can represent, return */
-	if(tmp >= RTE_MAX_ETHPORTS)
+	if (tmp >= RTE_MAX_ETHPORTS)
 		return;
 	port_id = (portid_t)tmp;
 
@@ -4108,17 +4109,17 @@ cmd_vlan_offload_parsed(void *parsed_result,
 
 	if (!strcmp(res->what, "strip"))
 		rx_vlan_strip_set(port_id,  on);
-	else if(!strcmp(res->what, "stripq")){
+	else if (!strcmp(res->what, "stripq")) {
 		uint16_t queue_id = 0;
 
 		/* No queue_id, return */
-		if(i + 1 >= len) {
+		if (i + 1 >= len) {
 			fprintf(stderr, "must specify (port,queue_id)\n");
 			return;
 		}
 		tmp = strtoul(str + i + 1, NULL, 0);
 		/* If queue_id greater that what 16-bits can represent, return */
-		if(tmp > 0xffff)
+		if (tmp > 0xffff)
 			return;
 
 		queue_id = (uint16_t)tmp;
@@ -7207,7 +7208,7 @@ static void cmd_mac_addr_parsed(void *parsed_result,
 		ret = rte_eth_dev_mac_addr_remove(res->port_num, &res->address);
 
 	/* check the return value and print it if is < 0 */
-	if(ret < 0)
+	if (ret < 0)
 		fprintf(stderr, "mac_addr_cmd error: (%s)\n", strerror(-ret));
 
 }
@@ -7780,7 +7781,7 @@ static void cmd_vf_mac_addr_parsed(void *parsed_result,
 						res->vf_num);
 #endif
 
-	if(ret < 0)
+	if (ret < 0)
 		fprintf(stderr, "vf_mac_addr_cmd error: (%s)\n", strerror(-ret));
 
 }
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index aed4cdcb8485..7fc6d91f0210 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -306,11 +306,12 @@ parse_portnuma_config(const char *q_arg)
 	/* reset from value set at definition */
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		p0 = strchr(p, ')');
+		if (p0 == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
@@ -366,11 +367,12 @@ parse_ringnuma_config(const char *q_arg)
 	/* reset from value set at definition */
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		p0 = strchr(p, ')');
+		if (p0 == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index aa7ea29f15ba..04b078a2938b 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2406,7 +2406,7 @@ start_packet_forwarding(int with_tx_first)
 
 	test_done = 0;
 
-	if(!no_flush_rx)
+	if (!no_flush_rx)
 		flush_fwd_rx_queues();
 
 	rxtx_config_display();
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 06/14] test: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
                     ` (4 preceding siblings ...)
  2022-11-09 19:53   ` [PATCH v2 05/14] testpmd: " Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 07/14] examples/qos_sched: " Stephen Hemminger
                     ` (7 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Olivier Matz, Yipeng Wang, Sameh Gobriel,
	Bruce Richardson, Vladimir Medvedkin, Anatoly Burakov

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/test_cmdline_cirbuf.c |  4 ++--
 app/test/test_debug.c          |  4 ++--
 app/test/test_hash.c           |  6 +++---
 app/test/test_lpm6_perf.c      |  2 +-
 app/test/test_malloc.c         | 14 +++++++-------
 app/test/test_mbuf.c           | 14 ++++++--------
 app/test/test_spinlock.c       |  2 +-
 7 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/app/test/test_cmdline_cirbuf.c b/app/test/test_cmdline_cirbuf.c
index 8ac326cb02e0..6f7aae6df59a 100644
--- a/app/test/test_cmdline_cirbuf.c
+++ b/app/test/test_cmdline_cirbuf.c
@@ -708,7 +708,7 @@ test_cirbuf_char_fill(void)
 		return -1;
 	}
 	/* delete buffer from tail */
-	for(i = 0; i < CMDLINE_TEST_BUFSIZE; i++)
+	for (i = 0; i < CMDLINE_TEST_BUFSIZE; i++)
 		cirbuf_del_tail_safe(&cb);
 	/* try to delete from an empty buffer */
 	if (cirbuf_del_tail_safe(&cb) >= 0) {
@@ -737,7 +737,7 @@ test_cirbuf_char_fill(void)
 		return -1;
 	}
 	/* delete buffer from head */
-	for(i = 0; i < CMDLINE_TEST_BUFSIZE; i++)
+	for (i = 0; i < CMDLINE_TEST_BUFSIZE; i++)
 		cirbuf_del_head_safe(&cb);
 	/* try to delete from an empty buffer */
 	if (cirbuf_del_head_safe(&cb) >= 0) {
diff --git a/app/test/test_debug.c b/app/test/test_debug.c
index 2704f5b92726..28fc2180e2b0 100644
--- a/app/test/test_debug.c
+++ b/app/test/test_debug.c
@@ -53,7 +53,7 @@ test_panic(void)
 		return -1;
 	}
 	wait(&status);
-	if(status == 0){
+	if (status == 0) {
 		printf("Child process terminated normally!\n");
 		return -1;
 	} else
@@ -84,7 +84,7 @@ test_exit_val(int exit_val)
 	}
 	wait(&status);
 	printf("Child process status: %d\n", status);
-	if(!WIFEXITED(status) || WEXITSTATUS(status) != (uint8_t)exit_val){
+	if (!WIFEXITED(status) || WEXITSTATUS(status) != (uint8_t)exit_val) {
 		printf("Child process terminated with incorrect status (expected = %d)!\n",
 				exit_val);
 		return -1;
diff --git a/app/test/test_hash.c b/app/test/test_hash.c
index 3e45afaa67fc..35d9d8a62ef8 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -724,12 +724,12 @@ static int test_five_keys(void)
 	}
 
 	/* Lookup */
-	for(i = 0; i < 5; i++)
+	for (i = 0; i < 5; i++)
 		key_array[i] = &keys[i];
 
 	ret = rte_hash_lookup_bulk(handle, &key_array[0], 5, (int32_t *)pos);
-	if(ret == 0)
-		for(i = 0; i < 5; i++) {
+	if (ret == 0)
+		for (i = 0; i < 5; i++) {
 			print_key_info("Lkp", key_array[i], pos[i]);
 			RETURN_IF_ERROR(pos[i] != expected_pos[i],
 					"failed to find key (pos[%u]=%d)", i, pos[i]);
diff --git a/app/test/test_lpm6_perf.c b/app/test/test_lpm6_perf.c
index aaf2773b6fac..2f9321345e4b 100644
--- a/app/test/test_lpm6_perf.c
+++ b/app/test/test_lpm6_perf.c
@@ -47,7 +47,7 @@ print_route_distribution(const struct rules_tbl_entry *table, uint32_t n)
 	printf("--------------------------- \n");
 
 	/* Count depths. */
-	for(i = 1; i <= 128; i++) {
+	for (i = 1; i <= 128; i++) {
 		unsigned depth_counter = 0;
 		double percent_hits;
 
diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c
index de40e506113a..8d3750a3f1f0 100644
--- a/app/test/test_malloc.c
+++ b/app/test/test_malloc.c
@@ -86,8 +86,8 @@ test_align_overlap_per_lcore(__rte_unused void *arg)
 			ret = -1;
 			break;
 		}
-		for(j = 0; j < 1000 ; j++) {
-			if( *(char *)p1 != 0) {
+		for (j = 0; j < 1000 ; j++) {
+			if (*(char *)p1 != 0) {
 				printf("rte_zmalloc didn't zero the allocated memory\n");
 				ret = -1;
 			}
@@ -157,8 +157,8 @@ test_reordered_free_per_lcore(__rte_unused void *arg)
 			ret = -1;
 			break;
 		}
-		for(j = 0; j < 1000 ; j++) {
-			if( *(char *)p1 != 0) {
+		for (j = 0; j < 1000 ; j++) {
+			if (*(char *)p1 != 0) {
 				printf("rte_zmalloc didn't zero the allocated memory\n");
 				ret = -1;
 			}
@@ -331,12 +331,12 @@ test_multi_alloc_statistics(void)
 	/* After freeing both allocations check stats return to original */
 	rte_malloc_get_socket_stats(socket, &post_stats);
 
-	if(second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) {
+	if (second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) {
 		printf("Incorrect heap statistics: Total size \n");
 		return -1;
 	}
 	/* Check allocated size is equal to two additions plus overhead */
-	if(second_stats.heap_allocsz_bytes !=
+	if (second_stats.heap_allocsz_bytes !=
 			size + overhead + first_stats.heap_allocsz_bytes) {
 		printf("Incorrect heap statistics: Allocated size \n");
 		return -1;
@@ -495,7 +495,7 @@ test_realloc_socket(int socket)
 		return -1;
 	}
 	/* calc an alignment we don't already have */
-	while(RTE_PTR_ALIGN(ptr7, new_align) == ptr7)
+	while (RTE_PTR_ALIGN(ptr7, new_align) == ptr7)
 		new_align *= 2;
 	char *ptr8 = rte_realloc_socket(ptr7, size7, new_align, socket);
 	if (!ptr8){
diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 53fe898a384c..fceacb8fead8 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -120,7 +120,7 @@ static unsigned refcnt_lcore[RTE_MAX_LCORE];
 		printf("mbuf test FAILED (l.%d): <" str ">\n",		\
 		       __LINE__,  ##__VA_ARGS__);			\
 		goto fail;						\
-} while(0)
+} while (0)
 
 /*
  * test data manipulation in mbuf with non-ascii data
@@ -154,9 +154,7 @@ test_pktmbuf_with_non_ascii_data(struct rte_mempool *pktmbuf_pool)
 	return 0;
 
 fail:
-	if(m) {
-		rte_pktmbuf_free(m);
-	}
+	rte_pktmbuf_free(m);
 	return -1;
 }
 
@@ -701,12 +699,12 @@ test_pktmbuf_pool(struct rte_mempool *pktmbuf_pool)
 	}
 	struct rte_mbuf *extra = NULL;
 	extra = rte_pktmbuf_alloc(pktmbuf_pool);
-	if(extra != NULL) {
+	if (extra != NULL) {
 		printf("Error pool not empty");
 		ret = -1;
 	}
 	extra = rte_pktmbuf_clone(m[0], pktmbuf_pool);
-	if(extra != NULL) {
+	if (extra != NULL) {
 		printf("Error pool not empty");
 		ret = -1;
 	}
@@ -966,7 +964,7 @@ test_pktmbuf_free_segment(struct rte_mempool *pktmbuf_pool)
 			struct rte_mbuf *mb, *mt;
 
 			mb = m[i];
-			while(mb != NULL) {
+			while (mb != NULL) {
 				mt = mb;
 				mb = mb->next;
 				rte_pktmbuf_free_seg(mt);
@@ -1195,7 +1193,7 @@ verify_mbuf_check_panics(struct rte_mbuf *buf)
 		return -1;
 	}
 	wait(&status);
-	if(status == 0)
+	if (status == 0)
 		return -1;
 
 	return 0;
diff --git a/app/test/test_spinlock.c b/app/test/test_spinlock.c
index 3f59372300c3..3ee82fa963a5 100644
--- a/app/test/test_spinlock.c
+++ b/app/test/test_spinlock.c
@@ -237,7 +237,7 @@ test_spinlock(void)
 	/*
 	 * Try to acquire a lock that we already own
 	 */
-	if(!rte_spinlock_recursive_trylock(&slr)) {
+	if (!rte_spinlock_recursive_trylock(&slr)) {
 		printf("rte_spinlock_recursive_trylock failed on a lock that "
 		       "we already own\n");
 		ret = -1;
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 07/14] examples/qos_sched: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
                     ` (5 preceding siblings ...)
  2022-11-09 19:53   ` [PATCH v2 06/14] test: " Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 08/14] examples/vhost: " Stephen Hemminger
                     ` (6 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Cristian Dumitrescu

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/qos_sched/app_thread.c | 6 +++---
 examples/qos_sched/args.c       | 2 +-
 examples/qos_sched/init.c       | 2 +-
 examples/qos_sched/main.c       | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/examples/qos_sched/app_thread.c b/examples/qos_sched/app_thread.c
index dbc878b55394..a49356fecf5f 100644
--- a/examples/qos_sched/app_thread.c
+++ b/examples/qos_sched/app_thread.c
@@ -79,7 +79,7 @@ app_rx_thread(struct thread_conf **confs)
 		if (likely(nb_rx != 0)) {
 			APP_STATS_ADD(conf->stat.nb_rx, nb_rx);
 
-			for(i = 0; i < nb_rx; i++) {
+			for (i = 0; i < nb_rx; i++) {
 				get_pkt_sched(rx_mbufs[i],
 						&subport, &pipe, &traffic_class, &queue, &color);
 				rte_sched_port_pkt_write(conf->sched_port,
@@ -91,7 +91,7 @@ app_rx_thread(struct thread_conf **confs)
 
 			if (unlikely(rte_ring_sp_enqueue_bulk(conf->rx_ring,
 					(void **)rx_mbufs, nb_rx, NULL) == 0)) {
-				for(i = 0; i < nb_rx; i++) {
+				for (i = 0; i < nb_rx; i++) {
 					rte_pktmbuf_free(rx_mbufs[i]);
 
 					APP_STATS_ADD(conf->stat.nb_drop, 1);
@@ -137,7 +137,7 @@ app_send_packets(struct thread_conf *qconf, struct rte_mbuf **mbufs, uint32_t nb
 	uint32_t i, len;
 
 	len = qconf->n_mbufs;
-	for(i = 0; i < nb_pkt; i++) {
+	for (i = 0; i < nb_pkt; i++) {
 		qconf->m_table[len] = mbufs[i];
 		len++;
 		/* enough pkts to be sent */
diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
index b2959499ae9a..b752eb221f7c 100644
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -451,7 +451,7 @@ app_parse_args(int argc, char **argv)
 	/* sanity check for cores assignment */
 	nb_lcores = app_cpu_core_count();
 
-	for(i = 0; i < nb_pfc; i++) {
+	for (i = 0; i < nb_pfc; i++) {
 		if (qos_conf[i].rx_core >= nb_lcores) {
 			RTE_LOG(ERR, APP, "pfc %u: invalid RX lcore index %u\n", i + 1,
 					qos_conf[i].rx_core);
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 0709aec10c31..41b46b296298 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -323,7 +323,7 @@ int app_init(void)
 		rte_exit(EXIT_FAILURE, "Invalid configuration profile\n");
 
 	/* Initialize each active flow */
-	for(i = 0; i < nb_pfc; i++) {
+	for (i = 0; i < nb_pfc; i++) {
 		uint32_t socket = rte_lcore_to_socket_id(qos_conf[i].rx_core);
 		struct rte_ring *ring;
 
diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c
index dc6a17a6464a..7b757df0eb02 100644
--- a/examples/qos_sched/main.c
+++ b/examples/qos_sched/main.c
@@ -152,7 +152,7 @@ app_stat(void)
 	static struct rte_eth_stats tx_stats[MAX_DATA_STREAMS];
 
 	/* print statistics */
-	for(i = 0; i < nb_pfc; i++) {
+	for (i = 0; i < nb_pfc; i++) {
 		struct flow_conf *flow = &qos_conf[i];
 
 		rte_eth_stats_get(flow->rx_port, &stats);
@@ -212,7 +212,7 @@ main(int argc, char **argv)
 	}
 	else {
 		/* print statistics every second */
-		while(1) {
+		while (1) {
 			sleep(1);
 			app_stat();
 		}
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 08/14] examples/vhost: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
                     ` (6 preceding siblings ...)
  2022-11-09 19:53   ` [PATCH v2 07/14] examples/qos_sched: " Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 09/14] l3fwd: " Stephen Hemminger
                     ` (5 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Maxime Coquelin, Chenbo Xia

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/vhost/main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 42e53a0f9a4f..9fee966916e9 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1491,7 +1491,7 @@ switch_worker(void *arg __rte_unused)
 		}
 	}
 
-	while(1) {
+	while (1) {
 		drain_mbuf_table(tx_q);
 		drain_vhost_table();
 		/*
@@ -1583,9 +1583,8 @@ destroy_device(int vid)
 		return;
 	/*set the remove flag. */
 	vdev->remove = 1;
-	while(vdev->ready != DEVICE_SAFE_REMOVE) {
+	while (vdev->ready != DEVICE_SAFE_REMOVE)
 		rte_pause();
-	}
 
 	for (i = 0; i < RTE_MAX_LCORE; i++)
 		rte_free(vhost_txbuff[i * RTE_MAX_VHOST_DEVICE + vid]);
@@ -1816,7 +1815,7 @@ print_stats(__rte_unused void *arg)
 	const char clr[] = { 27, '[', '2', 'J', '\0' };
 	const char top_left[] = { 27, '[', '1', ';', '1', 'H','\0' };
 
-	while(1) {
+	while (1) {
 		sleep(enable_stats);
 
 		/* Clear screen and move to top left */
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 09/14] l3fwd: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
                     ` (7 preceding siblings ...)
  2022-11-09 19:53   ` [PATCH v2 08/14] examples/vhost: " Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 10/14] examples: " Stephen Hemminger
                     ` (4 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, David Hunt

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/l3fwd-power/main.c | 7 ++++---
 examples/l3fwd/main.c       | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd3ade330f82..7bd5d8cb2281 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1787,11 +1787,12 @@ parse_config(const char *q_arg)
 
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		p0 = strchr(p, ')');
+		if (p0 == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
@@ -2946,7 +2947,7 @@ main(int argc, char **argv)
 		fflush(stdout);
 
 		/* init RX queues */
-		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+		for (queue = 0; queue < qconf->n_rx_queue; ++queue) {
 			struct rte_eth_rxconf rxq_conf;
 
 			portid = qconf->rx_queue_list[queue].port_id;
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 5198ff30dd00..2b8575137d50 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -516,11 +516,12 @@ parse_config(const char *q_arg)
 
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		p0 = strchr(p, ')');
+		if (p0 == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
@@ -1366,7 +1367,7 @@ l3fwd_poll_resource_setup(void)
 		printf("\nInitializing rx queues on lcore %u ... ", lcore_id );
 		fflush(stdout);
 		/* init RX queues */
-		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+		for (queue = 0; queue < qconf->n_rx_queue; ++queue) {
 			struct rte_eth_rxconf rxq_conf;
 
 			portid = qconf->rx_queue_list[queue].port_id;
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 10/14] examples: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
                     ` (8 preceding siblings ...)
  2022-11-09 19:53   ` [PATCH v2 09/14] l3fwd: " Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 11/14] bus/pci: " Stephen Hemminger
                     ` (3 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Olivier Matz, Konstantin Ananyev, Anatoly Burakov

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/cmdline/parse_obj_list.c          | 2 +-
 examples/ip_reassembly/main.c              | 2 +-
 examples/multi_process/symmetric_mp/main.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/examples/cmdline/parse_obj_list.c b/examples/cmdline/parse_obj_list.c
index 959bcd14527e..759072d39620 100644
--- a/examples/cmdline/parse_obj_list.c
+++ b/examples/cmdline/parse_obj_list.c
@@ -42,7 +42,7 @@ parse_obj_list(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,
 	if (res && ressize < sizeof(struct object *))
 		return -1;
 
-	while(!cmdline_isendoftoken(buf[token_len]))
+	while (!cmdline_isendoftoken(buf[token_len]))
 		token_len++;
 
 	SLIST_FOREACH(o, tkd->list, next) {
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index bd0b1d31decf..7e84b4944759 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -300,7 +300,7 @@ send_single_packet(struct rte_mbuf *m, uint16_t port)
 
 	TX_LCORE_STAT_UPDATE(&qconf->tx_stat, queue, 1);
 	txmb->m_table[txmb->head] = m;
-	if(++txmb->head == len)
+	if (++txmb->head == len)
 		txmb->head = 0;
 
 	return 0;
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 1ff85875dfdf..2f4441049253 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -156,7 +156,7 @@ smp_parse_args(int argc, char **argv)
 
 	/* get the port numbers from the port mask */
 	RTE_ETH_FOREACH_DEV(i)
-		if(port_mask & (1 << i))
+		if (port_mask & (1 << i))
 			ports[num_ports++] = (uint8_t)i;
 
 	ret = optind-1;
@@ -470,8 +470,8 @@ main(int argc, char **argv)
 	/* Primary instance initialized. 8< */
 	if (num_ports & 1)
 		rte_exit(EXIT_FAILURE, "Application must use an even number of ports\n");
-	for(i = 0; i < num_ports; i++){
-		if(proc_type == RTE_PROC_PRIMARY)
+	for (i = 0; i < num_ports; i++) {
+		if (proc_type == RTE_PROC_PRIMARY)
 			if (smp_port_init(ports[i], mp, (uint16_t)num_procs) < 0)
 				rte_exit(EXIT_FAILURE, "Error initialising ports\n");
 	}
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 11/14] bus/pci: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
                     ` (9 preceding siblings ...)
  2022-11-09 19:53   ` [PATCH v2 10/14] examples: " Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 12/14] net/e1000: " Stephen Hemminger
                     ` (2 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/pci/bsd/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c
index 7459d15c7e31..056e2eda2d5f 100644
--- a/drivers/bus/pci/bsd/pci.c
+++ b/drivers/bus/pci/bsd/pci.c
@@ -368,7 +368,7 @@ rte_pci_scan(void)
 		}
 
 		dev_count += conf_io.num_matches;
-	} while(conf_io.status == PCI_GETCONF_MORE_DEVS);
+	} while (conf_io.status == PCI_GETCONF_MORE_DEVS);
 
 	close(fd);
 
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 12/14] net/e1000: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
                     ` (10 preceding siblings ...)
  2022-11-09 19:53   ` [PATCH v2 11/14] bus/pci: " Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 13/14] net/i40e: " Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 14/14] net/bnx2x: " Stephen Hemminger
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Simei Su, Wenjun Wu

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/e1000/em_ethdev.c  | 4 ++--
 drivers/net/e1000/igb_ethdev.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 8ee9be12ad19..146e74cfc76e 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -872,8 +872,8 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)
 			E1000_DEV_PRIVATE_TO_STATS(dev->data->dev_private);
 	int pause_frames;
 
-	if(hw->phy.media_type == e1000_media_type_copper ||
-			(E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) {
+	if (hw->phy.media_type == e1000_media_type_copper ||
+	    (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) {
 		stats->symerrs += E1000_READ_REG(hw,E1000_SYMERRS);
 		stats->sec += E1000_READ_REG(hw, E1000_SEC);
 	}
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 8858f975f8cc..67e82d708964 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -1683,7 +1683,7 @@ igb_read_stats_registers(struct e1000_hw *hw, struct e1000_hw_stats *stats)
 	uint64_t old_rpthc = stats->rpthc;
 	uint64_t old_hgptc = stats->hgptc;
 
-	if(hw->phy.media_type == e1000_media_type_copper ||
+	if (hw->phy.media_type == e1000_media_type_copper ||
 	    (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) {
 		stats->symerrs +=
 		    E1000_READ_REG(hw,E1000_SYMERRS);
@@ -3500,10 +3500,10 @@ static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on)
 
 	for (i = 0; i < IGB_VFTA_SIZE; i++){
 		vfta = shadow_vfta->vfta[i];
-		if(vfta){
+		if (vfta) {
 			mask = 1;
 			for (j = 0; j < 32; j++){
-				if(vfta & mask)
+				if (vfta & mask)
 					igbvf_set_vfta(hw,
 						(uint16_t)((i<<5)+j), on);
 				mask<<=1;
@@ -3528,7 +3528,7 @@ igbvf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 
 	/*vind is not used in VF driver, set to 0, check ixgbe_set_vfta_vf*/
 	ret = igbvf_set_vfta(hw, vlan_id, !!on);
-	if(ret){
+	if (ret) {
 		PMD_INIT_LOG(ERR, "Unable to set VF vlan");
 		return ret;
 	}
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 13/14] net/i40e: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
                     ` (11 preceding siblings ...)
  2022-11-09 19:53   ` [PATCH v2 12/14] net/e1000: " Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  2022-11-09 19:53   ` [PATCH v2 14/14] net/bnx2x: " Stephen Hemminger
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Yuying Zhang, Beilei Xing

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/i40e/i40e_pf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 15d9ff868f3a..7050e0057d8e 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -956,7 +956,7 @@ i40e_pf_host_process_cmd_add_vlan(struct i40e_pf_vf *vf,
 
 	for (i = 0; i < vlan_filter_list->num_elements; i++) {
 		ret = i40e_vsi_add_vlan(vf->vsi, vid[i]);
-		if(ret != I40E_SUCCESS)
+		if (ret != I40E_SUCCESS)
 			goto send_msg;
 	}
 
@@ -996,7 +996,7 @@ i40e_pf_host_process_cmd_del_vlan(struct i40e_pf_vf *vf,
 	vid = vlan_filter_list->vlan_id;
 	for (i = 0; i < vlan_filter_list->num_elements; i++) {
 		ret = i40e_vsi_delete_vlan(vf->vsi, vid[i]);
-		if(ret != I40E_SUCCESS)
+		if (ret != I40E_SUCCESS)
 			goto send_msg;
 	}
 
@@ -1577,12 +1577,12 @@ i40e_pf_host_init(struct rte_eth_dev *dev)
 	 * return if SRIOV not enabled, VF number not configured or
 	 * no queue assigned.
 	 */
-	if(!hw->func_caps.sr_iov_1_1 || pf->vf_num == 0 || pf->vf_nb_qps == 0)
+	if (!hw->func_caps.sr_iov_1_1 || pf->vf_num == 0 || pf->vf_nb_qps == 0)
 		return I40E_SUCCESS;
 
 	/* Allocate memory to store VF structure */
 	pf->vfs = rte_zmalloc("i40e_pf_vf",sizeof(*pf->vfs) * pf->vf_num, 0);
-	if(pf->vfs == NULL)
+	if (pf->vfs == NULL)
 		return -ENOMEM;
 
 	/* Disable irq0 for VFR event */
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 14/14] net/bnx2x: fix whitespace
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
                     ` (12 preceding siblings ...)
  2022-11-09 19:53   ` [PATCH v2 13/14] net/i40e: " Stephen Hemminger
@ 2022-11-09 19:53   ` Stephen Hemminger
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 19:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Rasesh Mody, Shahed Shaikh

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bnx2x/bnx2x.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 89414ac88a93..9cb927e25449 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -96,7 +96,7 @@ int bnx2x_ilog2(int x)
 	int log = 0;
 	x >>= 1;
 
-	while(x) {
+	while (x) {
 		log++;
 		x >>= 1;
 	}
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 00/14] whitespace after keywords
  2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
                   ` (14 preceding siblings ...)
  2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
@ 2022-11-09 23:24 ` Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 01/14] eal: fix whitespace Stephen Hemminger
                     ` (13 more replies)
  15 siblings, 14 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The DPDK standard now enforced through checkpatch is to use
a space after keywords. Much of the older code that was grandfathered
in doesn't follow that, so fix it.

No urgency to this patchset, and it might just be viewed as churn.
But I prefer to read code that looks all the same.

“A foolish consistency is the hobgoblin of little minds, adored by
little statesmen and philosophers and divines. With consistency a
great soul has simply nothing to do. He may as well concern himself
with his shadow on the wall."  -- Ralph Waldo Emerson

v3 - fix typo in previous version (forgot to remove one brace)
     and find a few more leftover uses of "for(" and "while("

Stephen Hemminger (14):
  eal: fix whitespace
  cmdline: fix whitespace
  timer: fix whitespace
  ip_frag: fix whitespace
  testpmd: fix whitespace
  test: fix whitespace
  examples/qos_sched: fix whitespace
  examples/vhost: fix whitespace
  l3fwd: fix whitespace
  examples: fix whitespace
  bus/pci: fix whitespace
  net/e1000: fix whitespace
  net/i40e: fix whitespace
  net/bnx2x: fix whitespace

 app/test-pmd/cmdline.c                     | 31 +++++++++++-----------
 app/test-pmd/parameters.c                  | 10 ++++---
 app/test-pmd/testpmd.c                     |  2 +-
 app/test/test_cmdline_cirbuf.c             |  4 +--
 app/test/test_debug.c                      |  4 +--
 app/test/test_hash.c                       |  6 ++---
 app/test/test_lpm6_perf.c                  |  2 +-
 app/test/test_malloc.c                     | 14 +++++-----
 app/test/test_mbuf.c                       | 14 +++++-----
 app/test/test_ring_perf.c                  |  2 +-
 app/test/test_spinlock.c                   |  2 +-
 drivers/bus/pci/bsd/pci.c                  |  2 +-
 drivers/net/bnx2x/bnx2x.h                  |  2 +-
 drivers/net/e1000/em_ethdev.c              |  4 +--
 drivers/net/e1000/igb_ethdev.c             |  8 +++---
 drivers/net/e1000/igb_pf.c                 |  2 +-
 drivers/net/e1000/igb_rxtx.c               |  2 +-
 drivers/net/i40e/i40e_pf.c                 |  8 +++---
 examples/cmdline/parse_obj_list.c          |  2 +-
 examples/ip_reassembly/main.c              |  2 +-
 examples/l3fwd-power/main.c                |  7 ++---
 examples/l3fwd/main.c                      |  7 ++---
 examples/multi_process/symmetric_mp/main.c |  6 ++---
 examples/qos_sched/app_thread.c            |  6 ++---
 examples/qos_sched/args.c                  |  2 +-
 examples/qos_sched/init.c                  |  2 +-
 examples/qos_sched/main.c                  |  4 +--
 examples/vhost/main.c                      |  7 +++--
 lib/cmdline/cmdline_parse_string.c         | 17 +++++-------
 lib/cmdline/cmdline_rdline.c               | 12 ++++-----
 lib/eal/include/generic/rte_cycles.h       |  4 +--
 lib/eal/linux/eal_hugepage_info.c          |  6 ++---
 lib/eal/linux/eal_interrupts.c             |  2 +-
 lib/ip_frag/rte_ipv4_reassembly.c          |  2 +-
 lib/timer/rte_timer.c                      |  2 +-
 35 files changed, 104 insertions(+), 105 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 01/14] eal: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 02/14] cmdline: " Stephen Hemminger
                     ` (12 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Harman Kalra

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/eal/include/generic/rte_cycles.h | 4 ++--
 lib/eal/linux/eal_hugepage_info.c    | 6 +++---
 lib/eal/linux/eal_interrupts.c       | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/eal/include/generic/rte_cycles.h b/lib/eal/include/generic/rte_cycles.h
index f4fdca416570..e05b56e2cac6 100644
--- a/lib/eal/include/generic/rte_cycles.h
+++ b/lib/eal/include/generic/rte_cycles.h
@@ -94,7 +94,7 @@ static inline uint64_t
 rte_get_timer_cycles(void)
 {
 #ifdef RTE_LIBEAL_USE_HPET
-	switch(eal_timer_source) {
+	switch (eal_timer_source) {
 	case EAL_TIMER_TSC:
 #endif
 		return rte_get_tsc_cycles();
@@ -116,7 +116,7 @@ static inline uint64_t
 rte_get_timer_hz(void)
 {
 #ifdef RTE_LIBEAL_USE_HPET
-	switch(eal_timer_source) {
+	switch (eal_timer_source) {
 	case EAL_TIMER_TSC:
 #endif
 		return rte_get_tsc_hz();
diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index a1b6cb31ff1a..b6d751a2ee97 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -180,8 +180,8 @@ get_default_hp_size(void)
 	FILE *fd = fopen(proc_meminfo, "r");
 	if (fd == NULL)
 		rte_panic("Cannot open %s\n", proc_meminfo);
-	while(fgets(buffer, sizeof(buffer), fd)){
-		if (strncmp(buffer, str_hugepagesz, hugepagesz_len) == 0){
+	while (fgets(buffer, sizeof(buffer), fd)) {
+		if (strncmp(buffer, str_hugepagesz, hugepagesz_len) == 0) {
 			size = rte_str_to_size(&buffer[hugepagesz_len]);
 			break;
 		}
@@ -231,7 +231,7 @@ get_hugepage_dir(uint64_t hugepage_sz, char *hugedir, int len)
 	if (default_size == 0)
 		default_size = get_default_hp_size();
 
-	while (fgets(buf, sizeof(buf), fd)){
+	while (fgets(buf, sizeof(buf), fd)) {
 		const char *pagesz_str;
 
 		if (rte_strsplit(buf, sizeof(buf), splitstr, _FIELDNAME_MAX,
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index d52ec8eb4cd7..3be1b090be9e 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -1073,7 +1073,7 @@ eal_intr_handle_interrupts(int pfd, unsigned totalfds)
 	struct epoll_event events[totalfds];
 	int nfds = 0;
 
-	for(;;) {
+	for (;;) {
 		nfds = epoll_wait(pfd, events, totalfds,
 			EAL_INTR_EPOLL_WAIT_FOREVER);
 		/* epoll_wait fail */
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 02/14] cmdline: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 01/14] eal: fix whitespace Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 03/14] timer: " Stephen Hemminger
                     ` (11 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Olivier Matz

Add space after keywords.
Remove unnecessary spaces in if expressions.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/cmdline/cmdline_parse_string.c | 17 +++++++----------
 lib/cmdline/cmdline_rdline.c       | 12 ++++++------
 2 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/lib/cmdline/cmdline_parse_string.c b/lib/cmdline/cmdline_parse_string.c
index d756638905a2..4224983d2e73 100644
--- a/lib/cmdline/cmdline_parse_string.c
+++ b/lib/cmdline/cmdline_parse_string.c
@@ -73,20 +73,17 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,
 			token_len = get_token_len(str);
 
 			/* if token is too big... */
-			if (token_len >= STR_TOKEN_SIZE - 1) {
+			if (token_len >= STR_TOKEN_SIZE - 1)
 				continue;
-			}
 
-			if ( strncmp(buf, str, token_len) ) {
+			if (strncmp(buf, str, token_len))
 				continue;
-			}
 
-			if ( !cmdline_isendoftoken(*(buf+token_len)) ) {
+			if (!cmdline_isendoftoken(*(buf+token_len)))
 				continue;
-			}
 
 			break;
-		} while ( (str = get_next_token(str)) != NULL );
+		} while ((str = get_next_token(str)) != NULL);
 
 		if (!str)
 			return -1;
@@ -108,7 +105,7 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,
 	/* unspecified string (unknown single token) */
 	else {
 		token_len = 0;
-		while(!cmdline_isendoftoken(buf[token_len]) &&
+		while (!cmdline_isendoftoken(buf[token_len]) &&
 		      token_len < (STR_TOKEN_SIZE-1))
 			token_len++;
 
@@ -149,9 +146,9 @@ int cmdline_complete_get_nb_string(cmdline_parse_token_hdr_t *tk)
 		return 0;
 
 	str = sd->str;
-	while( (str = get_next_token(str)) != NULL ) {
+	while ((str = get_next_token(str)) != NULL)
 		ret++;
-	}
+
 	return ret;
 }
 
diff --git a/lib/cmdline/cmdline_rdline.c b/lib/cmdline/cmdline_rdline.c
index 5cf723a0126a..b5927879d48f 100644
--- a/lib/cmdline/cmdline_rdline.c
+++ b/lib/cmdline/cmdline_rdline.c
@@ -301,7 +301,7 @@ rdline_char_in(struct rdline *rdl, char c)
 		/* delete 1 char from the left */
 		case CMDLINE_KEY_BKSPACE:
 		case CMDLINE_KEY_BKSPACE2:
-			if(!cirbuf_del_tail_safe(&rdl->left)) {
+			if (!cirbuf_del_tail_safe(&rdl->left)) {
 				rdline_puts(rdl, vt100_bs);
 				display_right_buffer(rdl, 1);
 			}
@@ -354,7 +354,7 @@ rdline_char_in(struct rdline *rdl, char c)
 		/* paste contents of kill buffer to the left side of caret */
 		case CMDLINE_KEY_CTRL_Y:
 			i=0;
-			while(CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
+			while (CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
 			      RDLINE_BUF_SIZE &&
 			      i < rdl->kill_size) {
 				cirbuf_add_tail(&rdl->left, rdl->kill_buf[i]);
@@ -403,10 +403,10 @@ rdline_char_in(struct rdline *rdl, char c)
 				tmp_size = strnlen(tmp_buf, sizeof(tmp_buf));
 				/* add chars */
 				if (ret == RDLINE_RES_COMPLETE) {
-					i=0;
-					while(CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
-					      RDLINE_BUF_SIZE &&
-					      i < tmp_size) {
+					i = 0;
+					while (CIRBUF_GET_LEN(&rdl->right) +
+					       CIRBUF_GET_LEN(&rdl->left) <
+					       RDLINE_BUF_SIZE && i < tmp_size) {
 						cirbuf_add_tail(&rdl->left, tmp_buf[i]);
 						rdl->write_char(rdl, tmp_buf[i]);
 						i++;
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 03/14] timer: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 01/14] eal: fix whitespace Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 02/14] cmdline: " Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 04/14] ip_frag: " Stephen Hemminger
                     ` (10 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Erik Gabriel Carrillo

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/timer/rte_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/timer/rte_timer.c b/lib/timer/rte_timer.c
index 85d67573eb9e..9eb73f1fed13 100644
--- a/lib/timer/rte_timer.c
+++ b/lib/timer/rte_timer.c
@@ -350,7 +350,7 @@ timer_get_prev_entries(uint64_t time_val, unsigned tim_lcore,
 {
 	unsigned lvl = priv_timer[tim_lcore].curr_skiplist_depth;
 	prev[lvl] = &priv_timer[tim_lcore].pending_head;
-	while(lvl != 0) {
+	while (lvl != 0) {
 		lvl--;
 		prev[lvl] = prev[lvl+1];
 		while (prev[lvl]->sl_next[lvl] &&
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 04/14] ip_frag: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
                     ` (2 preceding siblings ...)
  2022-11-09 23:24   ` [PATCH v3 03/14] timer: " Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 05/14] testpmd: " Stephen Hemminger
                     ` (9 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Konstantin Ananyev

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/ip_frag/rte_ipv4_reassembly.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ip_frag/rte_ipv4_reassembly.c b/lib/ip_frag/rte_ipv4_reassembly.c
index 4a89a5f5365a..88ee0aa63f62 100644
--- a/lib/ip_frag/rte_ipv4_reassembly.c
+++ b/lib/ip_frag/rte_ipv4_reassembly.c
@@ -34,7 +34,7 @@ ipv4_frag_reassemble(struct ip_frag_pkt *fp)
 		for (i = n; i != IP_FIRST_FRAG_IDX && ofs != first_len; i--) {
 
 			/* previous fragment found. */
-			if(fp->frags[i].ofs + fp->frags[i].len == ofs) {
+			if (fp->frags[i].ofs + fp->frags[i].len == ofs) {
 
 				RTE_ASSERT(curr_idx != i);
 
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 05/14] testpmd: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
                     ` (3 preceding siblings ...)
  2022-11-09 23:24   ` [PATCH v3 04/14] ip_frag: " Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  2022-11-11  6:30     ` Zhang, Yuying
  2022-11-09 23:24   ` [PATCH v3 06/14] test: " Stephen Hemminger
                     ` (8 subsequent siblings)
  13 siblings, 1 reply; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Aman Singh, Yuying Zhang

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test-pmd/cmdline.c    | 31 ++++++++++++++++---------------
 app/test-pmd/parameters.c | 10 ++++++----
 app/test-pmd/testpmd.c    |  2 +-
 3 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 8dc60e938830..7721006cc310 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2730,11 +2730,12 @@ parse_reta_config(const char *str,
 
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		p0 = strchr(p, ')');
+		if (p0 == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
@@ -3242,15 +3243,15 @@ cmd_config_thresh_parsed(void *parsed_result,
 
 	if (!strcmp(res->name, "txpt"))
 		tx_pthresh = res->value;
-	else if(!strcmp(res->name, "txht"))
+	else if (!strcmp(res->name, "txht"))
 		tx_hthresh = res->value;
-	else if(!strcmp(res->name, "txwt"))
+	else if (!strcmp(res->name, "txwt"))
 		tx_wthresh = res->value;
-	else if(!strcmp(res->name, "rxpt"))
+	else if (!strcmp(res->name, "rxpt"))
 		rx_pthresh = res->value;
-	else if(!strcmp(res->name, "rxht"))
+	else if (!strcmp(res->name, "rxht"))
 		rx_hthresh = res->value;
-	else if(!strcmp(res->name, "rxwt"))
+	else if (!strcmp(res->name, "rxwt"))
 		rx_wthresh = res->value;
 	else {
 		fprintf(stderr, "Unknown parameter\n");
@@ -4088,8 +4089,8 @@ cmd_vlan_offload_parsed(void *parsed_result,
 	len = strnlen(str, STR_TOKEN_SIZE);
 	i = 0;
 	/* Get port_id first */
-	while(i < len){
-		if(str[i] == ',')
+	while (i < len) {
+		if (str[i] == ',')
 			break;
 
 		i++;
@@ -4097,7 +4098,7 @@ cmd_vlan_offload_parsed(void *parsed_result,
 	str[i]='\0';
 	tmp = strtoul(str, NULL, 0);
 	/* If port_id greater that what portid_t can represent, return */
-	if(tmp >= RTE_MAX_ETHPORTS)
+	if (tmp >= RTE_MAX_ETHPORTS)
 		return;
 	port_id = (portid_t)tmp;
 
@@ -4108,17 +4109,17 @@ cmd_vlan_offload_parsed(void *parsed_result,
 
 	if (!strcmp(res->what, "strip"))
 		rx_vlan_strip_set(port_id,  on);
-	else if(!strcmp(res->what, "stripq")){
+	else if (!strcmp(res->what, "stripq")) {
 		uint16_t queue_id = 0;
 
 		/* No queue_id, return */
-		if(i + 1 >= len) {
+		if (i + 1 >= len) {
 			fprintf(stderr, "must specify (port,queue_id)\n");
 			return;
 		}
 		tmp = strtoul(str + i + 1, NULL, 0);
 		/* If queue_id greater that what 16-bits can represent, return */
-		if(tmp > 0xffff)
+		if (tmp > 0xffff)
 			return;
 
 		queue_id = (uint16_t)tmp;
@@ -7207,7 +7208,7 @@ static void cmd_mac_addr_parsed(void *parsed_result,
 		ret = rte_eth_dev_mac_addr_remove(res->port_num, &res->address);
 
 	/* check the return value and print it if is < 0 */
-	if(ret < 0)
+	if (ret < 0)
 		fprintf(stderr, "mac_addr_cmd error: (%s)\n", strerror(-ret));
 
 }
@@ -7780,7 +7781,7 @@ static void cmd_vf_mac_addr_parsed(void *parsed_result,
 						res->vf_num);
 #endif
 
-	if(ret < 0)
+	if (ret < 0)
 		fprintf(stderr, "vf_mac_addr_cmd error: (%s)\n", strerror(-ret));
 
 }
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index aed4cdcb8485..7fc6d91f0210 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -306,11 +306,12 @@ parse_portnuma_config(const char *q_arg)
 	/* reset from value set at definition */
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		p0 = strchr(p, ')');
+		if (p0 == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
@@ -366,11 +367,12 @@ parse_ringnuma_config(const char *q_arg)
 	/* reset from value set at definition */
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		p0 = strchr(p, ')');
+		if (p0 == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index aa7ea29f15ba..04b078a2938b 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2406,7 +2406,7 @@ start_packet_forwarding(int with_tx_first)
 
 	test_done = 0;
 
-	if(!no_flush_rx)
+	if (!no_flush_rx)
 		flush_fwd_rx_queues();
 
 	rxtx_config_display();
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 06/14] test: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
                     ` (4 preceding siblings ...)
  2022-11-09 23:24   ` [PATCH v3 05/14] testpmd: " Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 07/14] examples/qos_sched: " Stephen Hemminger
                     ` (7 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Olivier Matz, Yipeng Wang, Sameh Gobriel,
	Bruce Richardson, Vladimir Medvedkin, Anatoly Burakov,
	Honnappa Nagarahalli, Konstantin Ananyev

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/test_cmdline_cirbuf.c |  4 ++--
 app/test/test_debug.c          |  4 ++--
 app/test/test_hash.c           |  6 +++---
 app/test/test_lpm6_perf.c      |  2 +-
 app/test/test_malloc.c         | 14 +++++++-------
 app/test/test_mbuf.c           | 14 ++++++--------
 app/test/test_ring_perf.c      |  2 +-
 app/test/test_spinlock.c       |  2 +-
 8 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/app/test/test_cmdline_cirbuf.c b/app/test/test_cmdline_cirbuf.c
index 8ac326cb02e0..6f7aae6df59a 100644
--- a/app/test/test_cmdline_cirbuf.c
+++ b/app/test/test_cmdline_cirbuf.c
@@ -708,7 +708,7 @@ test_cirbuf_char_fill(void)
 		return -1;
 	}
 	/* delete buffer from tail */
-	for(i = 0; i < CMDLINE_TEST_BUFSIZE; i++)
+	for (i = 0; i < CMDLINE_TEST_BUFSIZE; i++)
 		cirbuf_del_tail_safe(&cb);
 	/* try to delete from an empty buffer */
 	if (cirbuf_del_tail_safe(&cb) >= 0) {
@@ -737,7 +737,7 @@ test_cirbuf_char_fill(void)
 		return -1;
 	}
 	/* delete buffer from head */
-	for(i = 0; i < CMDLINE_TEST_BUFSIZE; i++)
+	for (i = 0; i < CMDLINE_TEST_BUFSIZE; i++)
 		cirbuf_del_head_safe(&cb);
 	/* try to delete from an empty buffer */
 	if (cirbuf_del_head_safe(&cb) >= 0) {
diff --git a/app/test/test_debug.c b/app/test/test_debug.c
index 2704f5b92726..28fc2180e2b0 100644
--- a/app/test/test_debug.c
+++ b/app/test/test_debug.c
@@ -53,7 +53,7 @@ test_panic(void)
 		return -1;
 	}
 	wait(&status);
-	if(status == 0){
+	if (status == 0) {
 		printf("Child process terminated normally!\n");
 		return -1;
 	} else
@@ -84,7 +84,7 @@ test_exit_val(int exit_val)
 	}
 	wait(&status);
 	printf("Child process status: %d\n", status);
-	if(!WIFEXITED(status) || WEXITSTATUS(status) != (uint8_t)exit_val){
+	if (!WIFEXITED(status) || WEXITSTATUS(status) != (uint8_t)exit_val) {
 		printf("Child process terminated with incorrect status (expected = %d)!\n",
 				exit_val);
 		return -1;
diff --git a/app/test/test_hash.c b/app/test/test_hash.c
index 3e45afaa67fc..35d9d8a62ef8 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -724,12 +724,12 @@ static int test_five_keys(void)
 	}
 
 	/* Lookup */
-	for(i = 0; i < 5; i++)
+	for (i = 0; i < 5; i++)
 		key_array[i] = &keys[i];
 
 	ret = rte_hash_lookup_bulk(handle, &key_array[0], 5, (int32_t *)pos);
-	if(ret == 0)
-		for(i = 0; i < 5; i++) {
+	if (ret == 0)
+		for (i = 0; i < 5; i++) {
 			print_key_info("Lkp", key_array[i], pos[i]);
 			RETURN_IF_ERROR(pos[i] != expected_pos[i],
 					"failed to find key (pos[%u]=%d)", i, pos[i]);
diff --git a/app/test/test_lpm6_perf.c b/app/test/test_lpm6_perf.c
index aaf2773b6fac..2f9321345e4b 100644
--- a/app/test/test_lpm6_perf.c
+++ b/app/test/test_lpm6_perf.c
@@ -47,7 +47,7 @@ print_route_distribution(const struct rules_tbl_entry *table, uint32_t n)
 	printf("--------------------------- \n");
 
 	/* Count depths. */
-	for(i = 1; i <= 128; i++) {
+	for (i = 1; i <= 128; i++) {
 		unsigned depth_counter = 0;
 		double percent_hits;
 
diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c
index de40e506113a..8d3750a3f1f0 100644
--- a/app/test/test_malloc.c
+++ b/app/test/test_malloc.c
@@ -86,8 +86,8 @@ test_align_overlap_per_lcore(__rte_unused void *arg)
 			ret = -1;
 			break;
 		}
-		for(j = 0; j < 1000 ; j++) {
-			if( *(char *)p1 != 0) {
+		for (j = 0; j < 1000 ; j++) {
+			if (*(char *)p1 != 0) {
 				printf("rte_zmalloc didn't zero the allocated memory\n");
 				ret = -1;
 			}
@@ -157,8 +157,8 @@ test_reordered_free_per_lcore(__rte_unused void *arg)
 			ret = -1;
 			break;
 		}
-		for(j = 0; j < 1000 ; j++) {
-			if( *(char *)p1 != 0) {
+		for (j = 0; j < 1000 ; j++) {
+			if (*(char *)p1 != 0) {
 				printf("rte_zmalloc didn't zero the allocated memory\n");
 				ret = -1;
 			}
@@ -331,12 +331,12 @@ test_multi_alloc_statistics(void)
 	/* After freeing both allocations check stats return to original */
 	rte_malloc_get_socket_stats(socket, &post_stats);
 
-	if(second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) {
+	if (second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) {
 		printf("Incorrect heap statistics: Total size \n");
 		return -1;
 	}
 	/* Check allocated size is equal to two additions plus overhead */
-	if(second_stats.heap_allocsz_bytes !=
+	if (second_stats.heap_allocsz_bytes !=
 			size + overhead + first_stats.heap_allocsz_bytes) {
 		printf("Incorrect heap statistics: Allocated size \n");
 		return -1;
@@ -495,7 +495,7 @@ test_realloc_socket(int socket)
 		return -1;
 	}
 	/* calc an alignment we don't already have */
-	while(RTE_PTR_ALIGN(ptr7, new_align) == ptr7)
+	while (RTE_PTR_ALIGN(ptr7, new_align) == ptr7)
 		new_align *= 2;
 	char *ptr8 = rte_realloc_socket(ptr7, size7, new_align, socket);
 	if (!ptr8){
diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 53fe898a384c..fceacb8fead8 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -120,7 +120,7 @@ static unsigned refcnt_lcore[RTE_MAX_LCORE];
 		printf("mbuf test FAILED (l.%d): <" str ">\n",		\
 		       __LINE__,  ##__VA_ARGS__);			\
 		goto fail;						\
-} while(0)
+} while (0)
 
 /*
  * test data manipulation in mbuf with non-ascii data
@@ -154,9 +154,7 @@ test_pktmbuf_with_non_ascii_data(struct rte_mempool *pktmbuf_pool)
 	return 0;
 
 fail:
-	if(m) {
-		rte_pktmbuf_free(m);
-	}
+	rte_pktmbuf_free(m);
 	return -1;
 }
 
@@ -701,12 +699,12 @@ test_pktmbuf_pool(struct rte_mempool *pktmbuf_pool)
 	}
 	struct rte_mbuf *extra = NULL;
 	extra = rte_pktmbuf_alloc(pktmbuf_pool);
-	if(extra != NULL) {
+	if (extra != NULL) {
 		printf("Error pool not empty");
 		ret = -1;
 	}
 	extra = rte_pktmbuf_clone(m[0], pktmbuf_pool);
-	if(extra != NULL) {
+	if (extra != NULL) {
 		printf("Error pool not empty");
 		ret = -1;
 	}
@@ -966,7 +964,7 @@ test_pktmbuf_free_segment(struct rte_mempool *pktmbuf_pool)
 			struct rte_mbuf *mb, *mt;
 
 			mb = m[i];
-			while(mb != NULL) {
+			while (mb != NULL) {
 				mt = mb;
 				mb = mb->next;
 				rte_pktmbuf_free_seg(mt);
@@ -1195,7 +1193,7 @@ verify_mbuf_check_panics(struct rte_mbuf *buf)
 		return -1;
 	}
 	wait(&status);
-	if(status == 0)
+	if (status == 0)
 		return -1;
 
 	return 0;
diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c
index 2d8bb675a331..4cac9a94a73c 100644
--- a/app/test/test_ring_perf.c
+++ b/app/test/test_ring_perf.c
@@ -190,7 +190,7 @@ enqueue_dequeue_bulk_helper(const unsigned int flag, const int esize,
 #else
 	if (__sync_add_and_fetch(&lcore_count, 1) != 2)
 #endif
-		while(lcore_count != 2)
+		while (lcore_count != 2)
 			rte_pause();
 
 	burst = test_ring_calloc(MAX_BURST, esize);
diff --git a/app/test/test_spinlock.c b/app/test/test_spinlock.c
index 3f59372300c3..3ee82fa963a5 100644
--- a/app/test/test_spinlock.c
+++ b/app/test/test_spinlock.c
@@ -237,7 +237,7 @@ test_spinlock(void)
 	/*
 	 * Try to acquire a lock that we already own
 	 */
-	if(!rte_spinlock_recursive_trylock(&slr)) {
+	if (!rte_spinlock_recursive_trylock(&slr)) {
 		printf("rte_spinlock_recursive_trylock failed on a lock that "
 		       "we already own\n");
 		ret = -1;
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 07/14] examples/qos_sched: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
                     ` (5 preceding siblings ...)
  2022-11-09 23:24   ` [PATCH v3 06/14] test: " Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 08/14] examples/vhost: " Stephen Hemminger
                     ` (6 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Cristian Dumitrescu

Add space after keywords.

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/qos_sched/app_thread.c | 6 +++---
 examples/qos_sched/args.c       | 2 +-
 examples/qos_sched/init.c       | 2 +-
 examples/qos_sched/main.c       | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/examples/qos_sched/app_thread.c b/examples/qos_sched/app_thread.c
index dbc878b55394..a49356fecf5f 100644
--- a/examples/qos_sched/app_thread.c
+++ b/examples/qos_sched/app_thread.c
@@ -79,7 +79,7 @@ app_rx_thread(struct thread_conf **confs)
 		if (likely(nb_rx != 0)) {
 			APP_STATS_ADD(conf->stat.nb_rx, nb_rx);
 
-			for(i = 0; i < nb_rx; i++) {
+			for (i = 0; i < nb_rx; i++) {
 				get_pkt_sched(rx_mbufs[i],
 						&subport, &pipe, &traffic_class, &queue, &color);
 				rte_sched_port_pkt_write(conf->sched_port,
@@ -91,7 +91,7 @@ app_rx_thread(struct thread_conf **confs)
 
 			if (unlikely(rte_ring_sp_enqueue_bulk(conf->rx_ring,
 					(void **)rx_mbufs, nb_rx, NULL) == 0)) {
-				for(i = 0; i < nb_rx; i++) {
+				for (i = 0; i < nb_rx; i++) {
 					rte_pktmbuf_free(rx_mbufs[i]);
 
 					APP_STATS_ADD(conf->stat.nb_drop, 1);
@@ -137,7 +137,7 @@ app_send_packets(struct thread_conf *qconf, struct rte_mbuf **mbufs, uint32_t nb
 	uint32_t i, len;
 
 	len = qconf->n_mbufs;
-	for(i = 0; i < nb_pkt; i++) {
+	for (i = 0; i < nb_pkt; i++) {
 		qconf->m_table[len] = mbufs[i];
 		len++;
 		/* enough pkts to be sent */
diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
index b2959499ae9a..b752eb221f7c 100644
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -451,7 +451,7 @@ app_parse_args(int argc, char **argv)
 	/* sanity check for cores assignment */
 	nb_lcores = app_cpu_core_count();
 
-	for(i = 0; i < nb_pfc; i++) {
+	for (i = 0; i < nb_pfc; i++) {
 		if (qos_conf[i].rx_core >= nb_lcores) {
 			RTE_LOG(ERR, APP, "pfc %u: invalid RX lcore index %u\n", i + 1,
 					qos_conf[i].rx_core);
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 0709aec10c31..41b46b296298 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -323,7 +323,7 @@ int app_init(void)
 		rte_exit(EXIT_FAILURE, "Invalid configuration profile\n");
 
 	/* Initialize each active flow */
-	for(i = 0; i < nb_pfc; i++) {
+	for (i = 0; i < nb_pfc; i++) {
 		uint32_t socket = rte_lcore_to_socket_id(qos_conf[i].rx_core);
 		struct rte_ring *ring;
 
diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c
index dc6a17a6464a..7b757df0eb02 100644
--- a/examples/qos_sched/main.c
+++ b/examples/qos_sched/main.c
@@ -152,7 +152,7 @@ app_stat(void)
 	static struct rte_eth_stats tx_stats[MAX_DATA_STREAMS];
 
 	/* print statistics */
-	for(i = 0; i < nb_pfc; i++) {
+	for (i = 0; i < nb_pfc; i++) {
 		struct flow_conf *flow = &qos_conf[i];
 
 		rte_eth_stats_get(flow->rx_port, &stats);
@@ -212,7 +212,7 @@ main(int argc, char **argv)
 	}
 	else {
 		/* print statistics every second */
-		while(1) {
+		while (1) {
 			sleep(1);
 			app_stat();
 		}
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 08/14] examples/vhost: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
                     ` (6 preceding siblings ...)
  2022-11-09 23:24   ` [PATCH v3 07/14] examples/qos_sched: " Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  2022-11-10  1:48     ` Xia, Chenbo
  2022-11-09 23:24   ` [PATCH v3 09/14] l3fwd: " Stephen Hemminger
                     ` (5 subsequent siblings)
  13 siblings, 1 reply; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Maxime Coquelin, Chenbo Xia

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/vhost/main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 42e53a0f9a4f..9fee966916e9 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1491,7 +1491,7 @@ switch_worker(void *arg __rte_unused)
 		}
 	}
 
-	while(1) {
+	while (1) {
 		drain_mbuf_table(tx_q);
 		drain_vhost_table();
 		/*
@@ -1583,9 +1583,8 @@ destroy_device(int vid)
 		return;
 	/*set the remove flag. */
 	vdev->remove = 1;
-	while(vdev->ready != DEVICE_SAFE_REMOVE) {
+	while (vdev->ready != DEVICE_SAFE_REMOVE)
 		rte_pause();
-	}
 
 	for (i = 0; i < RTE_MAX_LCORE; i++)
 		rte_free(vhost_txbuff[i * RTE_MAX_VHOST_DEVICE + vid]);
@@ -1816,7 +1815,7 @@ print_stats(__rte_unused void *arg)
 	const char clr[] = { 27, '[', '2', 'J', '\0' };
 	const char top_left[] = { 27, '[', '1', ';', '1', 'H','\0' };
 
-	while(1) {
+	while (1) {
 		sleep(enable_stats);
 
 		/* Clear screen and move to top left */
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 09/14] l3fwd: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
                     ` (7 preceding siblings ...)
  2022-11-09 23:24   ` [PATCH v3 08/14] examples/vhost: " Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 10/14] examples: " Stephen Hemminger
                     ` (4 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, David Hunt

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/l3fwd-power/main.c | 7 ++++---
 examples/l3fwd/main.c       | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd3ade330f82..7bd5d8cb2281 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1787,11 +1787,12 @@ parse_config(const char *q_arg)
 
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		p0 = strchr(p, ')');
+		if (p0 == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
@@ -2946,7 +2947,7 @@ main(int argc, char **argv)
 		fflush(stdout);
 
 		/* init RX queues */
-		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+		for (queue = 0; queue < qconf->n_rx_queue; ++queue) {
 			struct rte_eth_rxconf rxq_conf;
 
 			portid = qconf->rx_queue_list[queue].port_id;
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 5198ff30dd00..2b8575137d50 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -516,11 +516,12 @@ parse_config(const char *q_arg)
 
 	while ((p = strchr(p0,'(')) != NULL) {
 		++p;
-		if((p0 = strchr(p,')')) == NULL)
+		p0 = strchr(p, ')');
+		if (p0 == NULL)
 			return -1;
 
 		size = p0 - p;
-		if(size >= sizeof(s))
+		if (size >= sizeof(s))
 			return -1;
 
 		snprintf(s, sizeof(s), "%.*s", size, p);
@@ -1366,7 +1367,7 @@ l3fwd_poll_resource_setup(void)
 		printf("\nInitializing rx queues on lcore %u ... ", lcore_id );
 		fflush(stdout);
 		/* init RX queues */
-		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+		for (queue = 0; queue < qconf->n_rx_queue; ++queue) {
 			struct rte_eth_rxconf rxq_conf;
 
 			portid = qconf->rx_queue_list[queue].port_id;
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 10/14] examples: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
                     ` (8 preceding siblings ...)
  2022-11-09 23:24   ` [PATCH v3 09/14] l3fwd: " Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 11/14] bus/pci: " Stephen Hemminger
                     ` (3 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Olivier Matz, Konstantin Ananyev, Anatoly Burakov

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/cmdline/parse_obj_list.c          | 2 +-
 examples/ip_reassembly/main.c              | 2 +-
 examples/multi_process/symmetric_mp/main.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/examples/cmdline/parse_obj_list.c b/examples/cmdline/parse_obj_list.c
index 959bcd14527e..759072d39620 100644
--- a/examples/cmdline/parse_obj_list.c
+++ b/examples/cmdline/parse_obj_list.c
@@ -42,7 +42,7 @@ parse_obj_list(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,
 	if (res && ressize < sizeof(struct object *))
 		return -1;
 
-	while(!cmdline_isendoftoken(buf[token_len]))
+	while (!cmdline_isendoftoken(buf[token_len]))
 		token_len++;
 
 	SLIST_FOREACH(o, tkd->list, next) {
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index bd0b1d31decf..7e84b4944759 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -300,7 +300,7 @@ send_single_packet(struct rte_mbuf *m, uint16_t port)
 
 	TX_LCORE_STAT_UPDATE(&qconf->tx_stat, queue, 1);
 	txmb->m_table[txmb->head] = m;
-	if(++txmb->head == len)
+	if (++txmb->head == len)
 		txmb->head = 0;
 
 	return 0;
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 1ff85875dfdf..2f4441049253 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -156,7 +156,7 @@ smp_parse_args(int argc, char **argv)
 
 	/* get the port numbers from the port mask */
 	RTE_ETH_FOREACH_DEV(i)
-		if(port_mask & (1 << i))
+		if (port_mask & (1 << i))
 			ports[num_ports++] = (uint8_t)i;
 
 	ret = optind-1;
@@ -470,8 +470,8 @@ main(int argc, char **argv)
 	/* Primary instance initialized. 8< */
 	if (num_ports & 1)
 		rte_exit(EXIT_FAILURE, "Application must use an even number of ports\n");
-	for(i = 0; i < num_ports; i++){
-		if(proc_type == RTE_PROC_PRIMARY)
+	for (i = 0; i < num_ports; i++) {
+		if (proc_type == RTE_PROC_PRIMARY)
 			if (smp_port_init(ports[i], mp, (uint16_t)num_procs) < 0)
 				rte_exit(EXIT_FAILURE, "Error initialising ports\n");
 	}
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 11/14] bus/pci: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
                     ` (9 preceding siblings ...)
  2022-11-09 23:24   ` [PATCH v3 10/14] examples: " Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 12/14] net/e1000: " Stephen Hemminger
                     ` (2 subsequent siblings)
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/pci/bsd/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c
index 7459d15c7e31..056e2eda2d5f 100644
--- a/drivers/bus/pci/bsd/pci.c
+++ b/drivers/bus/pci/bsd/pci.c
@@ -368,7 +368,7 @@ rte_pci_scan(void)
 		}
 
 		dev_count += conf_io.num_matches;
-	} while(conf_io.status == PCI_GETCONF_MORE_DEVS);
+	} while (conf_io.status == PCI_GETCONF_MORE_DEVS);
 
 	close(fd);
 
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 12/14] net/e1000: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
                     ` (10 preceding siblings ...)
  2022-11-09 23:24   ` [PATCH v3 11/14] bus/pci: " Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 13/14] net/i40e: " Stephen Hemminger
  2022-11-09 23:24   ` [PATCH v3 14/14] net/bnx2x: " Stephen Hemminger
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Simei Su, Wenjun Wu

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/e1000/em_ethdev.c  | 4 ++--
 drivers/net/e1000/igb_ethdev.c | 8 ++++----
 drivers/net/e1000/igb_pf.c     | 2 +-
 drivers/net/e1000/igb_rxtx.c   | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 8ee9be12ad19..146e74cfc76e 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -872,8 +872,8 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)
 			E1000_DEV_PRIVATE_TO_STATS(dev->data->dev_private);
 	int pause_frames;
 
-	if(hw->phy.media_type == e1000_media_type_copper ||
-			(E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) {
+	if (hw->phy.media_type == e1000_media_type_copper ||
+	    (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) {
 		stats->symerrs += E1000_READ_REG(hw,E1000_SYMERRS);
 		stats->sec += E1000_READ_REG(hw, E1000_SEC);
 	}
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 8858f975f8cc..67e82d708964 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -1683,7 +1683,7 @@ igb_read_stats_registers(struct e1000_hw *hw, struct e1000_hw_stats *stats)
 	uint64_t old_rpthc = stats->rpthc;
 	uint64_t old_hgptc = stats->hgptc;
 
-	if(hw->phy.media_type == e1000_media_type_copper ||
+	if (hw->phy.media_type == e1000_media_type_copper ||
 	    (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) {
 		stats->symerrs +=
 		    E1000_READ_REG(hw,E1000_SYMERRS);
@@ -3500,10 +3500,10 @@ static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on)
 
 	for (i = 0; i < IGB_VFTA_SIZE; i++){
 		vfta = shadow_vfta->vfta[i];
-		if(vfta){
+		if (vfta) {
 			mask = 1;
 			for (j = 0; j < 32; j++){
-				if(vfta & mask)
+				if (vfta & mask)
 					igbvf_set_vfta(hw,
 						(uint16_t)((i<<5)+j), on);
 				mask<<=1;
@@ -3528,7 +3528,7 @@ igbvf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 
 	/*vind is not used in VF driver, set to 0, check ixgbe_set_vfta_vf*/
 	ret = igbvf_set_vfta(hw, vlan_id, !!on);
-	if(ret){
+	if (ret) {
 		PMD_INIT_LOG(ERR, "Unable to set VF vlan");
 		return ret;
 	}
diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index c7588ea57eaa..b1f74eb841d2 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -78,7 +78,7 @@ void igb_pf_host_init(struct rte_eth_dev *eth_dev)
 
 	if (hw->mac.type == e1000_i350)
 		nb_queue = 1;
-	else if(hw->mac.type == e1000_82576)
+	else if (hw->mac.type == e1000_82576)
 		/* per datasheet, it should be 2, but 1 seems correct */
 		nb_queue = 1;
 	else
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index f32dee46df82..f5677da6b931 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -2276,7 +2276,7 @@ igb_dev_mq_rx_configure(struct rte_eth_dev *dev)
 		/* 011b Def_Q ignore, according to VT_CTL.DEF_PL */
 		mrqc |= 0x3 << E1000_MRQC_DEF_Q_SHIFT;
 		E1000_WRITE_REG(hw, E1000_MRQC, mrqc);
-	} else if(RTE_ETH_DEV_SRIOV(dev).active == 0) {
+	} else if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
 		/*
 		 * SRIOV inactive scheme
 		 */
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 13/14] net/i40e: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
                     ` (11 preceding siblings ...)
  2022-11-09 23:24   ` [PATCH v3 12/14] net/e1000: " Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  2022-11-11  6:23     ` Zhang, Yuying
  2022-11-09 23:24   ` [PATCH v3 14/14] net/bnx2x: " Stephen Hemminger
  13 siblings, 1 reply; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Yuying Zhang, Beilei Xing

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/i40e/i40e_pf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 15d9ff868f3a..7050e0057d8e 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -956,7 +956,7 @@ i40e_pf_host_process_cmd_add_vlan(struct i40e_pf_vf *vf,
 
 	for (i = 0; i < vlan_filter_list->num_elements; i++) {
 		ret = i40e_vsi_add_vlan(vf->vsi, vid[i]);
-		if(ret != I40E_SUCCESS)
+		if (ret != I40E_SUCCESS)
 			goto send_msg;
 	}
 
@@ -996,7 +996,7 @@ i40e_pf_host_process_cmd_del_vlan(struct i40e_pf_vf *vf,
 	vid = vlan_filter_list->vlan_id;
 	for (i = 0; i < vlan_filter_list->num_elements; i++) {
 		ret = i40e_vsi_delete_vlan(vf->vsi, vid[i]);
-		if(ret != I40E_SUCCESS)
+		if (ret != I40E_SUCCESS)
 			goto send_msg;
 	}
 
@@ -1577,12 +1577,12 @@ i40e_pf_host_init(struct rte_eth_dev *dev)
 	 * return if SRIOV not enabled, VF number not configured or
 	 * no queue assigned.
 	 */
-	if(!hw->func_caps.sr_iov_1_1 || pf->vf_num == 0 || pf->vf_nb_qps == 0)
+	if (!hw->func_caps.sr_iov_1_1 || pf->vf_num == 0 || pf->vf_nb_qps == 0)
 		return I40E_SUCCESS;
 
 	/* Allocate memory to store VF structure */
 	pf->vfs = rte_zmalloc("i40e_pf_vf",sizeof(*pf->vfs) * pf->vf_num, 0);
-	if(pf->vfs == NULL)
+	if (pf->vfs == NULL)
 		return -ENOMEM;
 
 	/* Disable irq0 for VFR event */
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v3 14/14] net/bnx2x: fix whitespace
  2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
                     ` (12 preceding siblings ...)
  2022-11-09 23:24   ` [PATCH v3 13/14] net/i40e: " Stephen Hemminger
@ 2022-11-09 23:24   ` Stephen Hemminger
  13 siblings, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-09 23:24 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Rasesh Mody, Shahed Shaikh

Add space after keywords.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bnx2x/bnx2x.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 89414ac88a93..9cb927e25449 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -96,7 +96,7 @@ int bnx2x_ilog2(int x)
 	int log = 0;
 	x >>= 1;
 
-	while(x) {
+	while (x) {
 		log++;
 		x >>= 1;
 	}
-- 
2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* RE: [PATCH v3 08/14] examples/vhost: fix whitespace
  2022-11-09 23:24   ` [PATCH v3 08/14] examples/vhost: " Stephen Hemminger
@ 2022-11-10  1:48     ` Xia, Chenbo
  0 siblings, 0 replies; 52+ messages in thread
From: Xia, Chenbo @ 2022-11-10  1:48 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Maxime Coquelin

> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Thursday, November 10, 2022 7:25 AM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Maxime Coquelin
> <maxime.coquelin@redhat.com>; Xia, Chenbo <chenbo.xia@intel.com>
> Subject: [PATCH v3 08/14] examples/vhost: fix whitespace
> 
> Add space after keywords.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  examples/vhost/main.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
> index 42e53a0f9a4f..9fee966916e9 100644
> --- a/examples/vhost/main.c
> +++ b/examples/vhost/main.c
> @@ -1491,7 +1491,7 @@ switch_worker(void *arg __rte_unused)
>  		}
>  	}
> 
> -	while(1) {
> +	while (1) {
>  		drain_mbuf_table(tx_q);
>  		drain_vhost_table();
>  		/*
> @@ -1583,9 +1583,8 @@ destroy_device(int vid)
>  		return;
>  	/*set the remove flag. */
>  	vdev->remove = 1;
> -	while(vdev->ready != DEVICE_SAFE_REMOVE) {
> +	while (vdev->ready != DEVICE_SAFE_REMOVE)
>  		rte_pause();
> -	}
> 
>  	for (i = 0; i < RTE_MAX_LCORE; i++)
>  		rte_free(vhost_txbuff[i * RTE_MAX_VHOST_DEVICE + vid]);
> @@ -1816,7 +1815,7 @@ print_stats(__rte_unused void *arg)
>  	const char clr[] = { 27, '[', '2', 'J', '\0' };
>  	const char top_left[] = { 27, '[', '1', ';', '1', 'H','\0' };
> 
> -	while(1) {
> +	while (1) {
>  		sleep(enable_stats);
> 
>  		/* Clear screen and move to top left */
> --
> 2.35.1

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* RE: [PATCH v3 13/14] net/i40e: fix whitespace
  2022-11-09 23:24   ` [PATCH v3 13/14] net/i40e: " Stephen Hemminger
@ 2022-11-11  6:23     ` Zhang, Yuying
  2022-11-11  7:12       ` Zhang, Yuying
  2022-11-11 16:48       ` Stephen Hemminger
  0 siblings, 2 replies; 52+ messages in thread
From: Zhang, Yuying @ 2022-11-11  6:23 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Xing, Beilei

Hi,

Could you add fix line and Cc: stable@dpdk.org?
The fix looks good to me.

> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: 2022年11月10日 7:25
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Zhang, Yuying
> <yuying.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Subject: [PATCH v3 13/14] net/i40e: fix whitespace
> 
> Add space after keywords.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-off-by: Yuying Zhang <yuying.zhang@intel.com>


> ---
>  drivers/net/i40e/i40e_pf.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index
> 15d9ff868f3a..7050e0057d8e 100644
> --- a/drivers/net/i40e/i40e_pf.c
> +++ b/drivers/net/i40e/i40e_pf.c
> @@ -956,7 +956,7 @@ i40e_pf_host_process_cmd_add_vlan(struct i40e_pf_vf
> *vf,
> 
>  	for (i = 0; i < vlan_filter_list->num_elements; i++) {
>  		ret = i40e_vsi_add_vlan(vf->vsi, vid[i]);
> -		if(ret != I40E_SUCCESS)
> +		if (ret != I40E_SUCCESS)
>  			goto send_msg;
>  	}
> 
> @@ -996,7 +996,7 @@ i40e_pf_host_process_cmd_del_vlan(struct i40e_pf_vf
> *vf,
>  	vid = vlan_filter_list->vlan_id;
>  	for (i = 0; i < vlan_filter_list->num_elements; i++) {
>  		ret = i40e_vsi_delete_vlan(vf->vsi, vid[i]);
> -		if(ret != I40E_SUCCESS)
> +		if (ret != I40E_SUCCESS)
>  			goto send_msg;
>  	}
> 
> @@ -1577,12 +1577,12 @@ i40e_pf_host_init(struct rte_eth_dev *dev)
>  	 * return if SRIOV not enabled, VF number not configured or
>  	 * no queue assigned.
>  	 */
> -	if(!hw->func_caps.sr_iov_1_1 || pf->vf_num == 0 || pf->vf_nb_qps == 0)
> +	if (!hw->func_caps.sr_iov_1_1 || pf->vf_num == 0 || pf->vf_nb_qps ==
> +0)
>  		return I40E_SUCCESS;
> 
>  	/* Allocate memory to store VF structure */
>  	pf->vfs = rte_zmalloc("i40e_pf_vf",sizeof(*pf->vfs) * pf->vf_num, 0);
> -	if(pf->vfs == NULL)
> +	if (pf->vfs == NULL)
>  		return -ENOMEM;
> 
>  	/* Disable irq0 for VFR event */
> --
> 2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* RE: [PATCH v3 05/14] testpmd: fix whitespace
  2022-11-09 23:24   ` [PATCH v3 05/14] testpmd: " Stephen Hemminger
@ 2022-11-11  6:30     ` Zhang, Yuying
  2022-11-11  7:12       ` Zhang, Yuying
  0 siblings, 1 reply; 52+ messages in thread
From: Zhang, Yuying @ 2022-11-11  6:30 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Singh, Aman Deep



> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: 2022年11月10日 7:25
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Singh, Aman Deep
> <aman.deep.singh@intel.com>; Zhang, Yuying <yuying.zhang@intel.com>
> Subject: [PATCH v3 05/14] testpmd: fix whitespace
> 
> Add space after keywords.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-off-by: Yuying Zhang <yuying.zhang@intel.com>

> ---
>  app/test-pmd/cmdline.c    | 31 ++++++++++++++++---------------
>  app/test-pmd/parameters.c | 10 ++++++----
>  app/test-pmd/testpmd.c    |  2 +-
>  3 files changed, 23 insertions(+), 20 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> 8dc60e938830..7721006cc310 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -2730,11 +2730,12 @@ parse_reta_config(const char *str,
> 
>  	while ((p = strchr(p0,'(')) != NULL) {
>  		++p;
> -		if((p0 = strchr(p,')')) == NULL)
> +		p0 = strchr(p, ')');
> +		if (p0 == NULL)
>  			return -1;
> 
>  		size = p0 - p;
> -		if(size >= sizeof(s))
> +		if (size >= sizeof(s))
>  			return -1;
> 
>  		snprintf(s, sizeof(s), "%.*s", size, p); @@ -3242,15 +3243,15
> @@ cmd_config_thresh_parsed(void *parsed_result,
> 
>  	if (!strcmp(res->name, "txpt"))
>  		tx_pthresh = res->value;
> -	else if(!strcmp(res->name, "txht"))
> +	else if (!strcmp(res->name, "txht"))
>  		tx_hthresh = res->value;
> -	else if(!strcmp(res->name, "txwt"))
> +	else if (!strcmp(res->name, "txwt"))
>  		tx_wthresh = res->value;
> -	else if(!strcmp(res->name, "rxpt"))
> +	else if (!strcmp(res->name, "rxpt"))
>  		rx_pthresh = res->value;
> -	else if(!strcmp(res->name, "rxht"))
> +	else if (!strcmp(res->name, "rxht"))
>  		rx_hthresh = res->value;
> -	else if(!strcmp(res->name, "rxwt"))
> +	else if (!strcmp(res->name, "rxwt"))
>  		rx_wthresh = res->value;
>  	else {
>  		fprintf(stderr, "Unknown parameter\n"); @@ -4088,8 +4089,8
> @@ cmd_vlan_offload_parsed(void *parsed_result,
>  	len = strnlen(str, STR_TOKEN_SIZE);
>  	i = 0;
>  	/* Get port_id first */
> -	while(i < len){
> -		if(str[i] == ',')
> +	while (i < len) {
> +		if (str[i] == ',')
>  			break;
> 
>  		i++;
> @@ -4097,7 +4098,7 @@ cmd_vlan_offload_parsed(void *parsed_result,
>  	str[i]='\0';
>  	tmp = strtoul(str, NULL, 0);
>  	/* If port_id greater that what portid_t can represent, return */
> -	if(tmp >= RTE_MAX_ETHPORTS)
> +	if (tmp >= RTE_MAX_ETHPORTS)
>  		return;
>  	port_id = (portid_t)tmp;
> 
> @@ -4108,17 +4109,17 @@ cmd_vlan_offload_parsed(void *parsed_result,
> 
>  	if (!strcmp(res->what, "strip"))
>  		rx_vlan_strip_set(port_id,  on);
> -	else if(!strcmp(res->what, "stripq")){
> +	else if (!strcmp(res->what, "stripq")) {
>  		uint16_t queue_id = 0;
> 
>  		/* No queue_id, return */
> -		if(i + 1 >= len) {
> +		if (i + 1 >= len) {
>  			fprintf(stderr, "must specify (port,queue_id)\n");
>  			return;
>  		}
>  		tmp = strtoul(str + i + 1, NULL, 0);
>  		/* If queue_id greater that what 16-bits can represent, return */
> -		if(tmp > 0xffff)
> +		if (tmp > 0xffff)
>  			return;
> 
>  		queue_id = (uint16_t)tmp;
> @@ -7207,7 +7208,7 @@ static void cmd_mac_addr_parsed(void
> *parsed_result,
>  		ret = rte_eth_dev_mac_addr_remove(res->port_num, &res-
> >address);
> 
>  	/* check the return value and print it if is < 0 */
> -	if(ret < 0)
> +	if (ret < 0)
>  		fprintf(stderr, "mac_addr_cmd error: (%s)\n", strerror(-ret));
> 
>  }
> @@ -7780,7 +7781,7 @@ static void cmd_vf_mac_addr_parsed(void
> *parsed_result,
>  						res->vf_num);
>  #endif
> 
> -	if(ret < 0)
> +	if (ret < 0)
>  		fprintf(stderr, "vf_mac_addr_cmd error: (%s)\n", strerror(-ret));
> 
>  }
> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index
> aed4cdcb8485..7fc6d91f0210 100644
> --- a/app/test-pmd/parameters.c
> +++ b/app/test-pmd/parameters.c
> @@ -306,11 +306,12 @@ parse_portnuma_config(const char *q_arg)
>  	/* reset from value set at definition */
>  	while ((p = strchr(p0,'(')) != NULL) {
>  		++p;
> -		if((p0 = strchr(p,')')) == NULL)
> +		p0 = strchr(p, ')');
> +		if (p0 == NULL)
>  			return -1;
> 
>  		size = p0 - p;
> -		if(size >= sizeof(s))
> +		if (size >= sizeof(s))
>  			return -1;
> 
>  		snprintf(s, sizeof(s), "%.*s", size, p); @@ -366,11 +367,12 @@
> parse_ringnuma_config(const char *q_arg)
>  	/* reset from value set at definition */
>  	while ((p = strchr(p0,'(')) != NULL) {
>  		++p;
> -		if((p0 = strchr(p,')')) == NULL)
> +		p0 = strchr(p, ')');
> +		if (p0 == NULL)
>  			return -1;
> 
>  		size = p0 - p;
> -		if(size >= sizeof(s))
> +		if (size >= sizeof(s))
>  			return -1;
> 
>  		snprintf(s, sizeof(s), "%.*s", size, p); diff --git a/app/test-
> pmd/testpmd.c b/app/test-pmd/testpmd.c index aa7ea29f15ba..04b078a2938b
> 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -2406,7 +2406,7 @@ start_packet_forwarding(int with_tx_first)
> 
>  	test_done = 0;
> 
> -	if(!no_flush_rx)
> +	if (!no_flush_rx)
>  		flush_fwd_rx_queues();
> 
>  	rxtx_config_display();
> --
> 2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* RE: [PATCH v3 05/14] testpmd: fix whitespace
  2022-11-11  6:30     ` Zhang, Yuying
@ 2022-11-11  7:12       ` Zhang, Yuying
  0 siblings, 0 replies; 52+ messages in thread
From: Zhang, Yuying @ 2022-11-11  7:12 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Singh, Aman Deep

fix

> -----Original Message-----
> From: Zhang, Yuying
> Sent: 2022年11月11日 14:30
> To: Stephen Hemminger <stephen@networkplumber.org>; dev@dpdk.org
> Cc: Singh, Aman Deep <Aman.Deep.Singh@intel.com>
> Subject: RE: [PATCH v3 05/14] testpmd: fix whitespace
> 
> 
> 
> > -----Original Message-----
> > From: Stephen Hemminger <stephen@networkplumber.org>
> > Sent: 2022年11月10日 7:25
> > To: dev@dpdk.org
> > Cc: Stephen Hemminger <stephen@networkplumber.org>; Singh, Aman Deep
> > <aman.deep.singh@intel.com>; Zhang, Yuying <yuying.zhang@intel.com>
> > Subject: [PATCH v3 05/14] testpmd: fix whitespace
> >
> > Add space after keywords.
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Yuying Zhang <yuying.zhang@intel.com>

> > ---
> >  app/test-pmd/cmdline.c    | 31 ++++++++++++++++---------------
> >  app/test-pmd/parameters.c | 10 ++++++----
> >  app/test-pmd/testpmd.c    |  2 +-
> >  3 files changed, 23 insertions(+), 20 deletions(-)
> >
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> > 8dc60e938830..7721006cc310 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> > @@ -2730,11 +2730,12 @@ parse_reta_config(const char *str,
> >
> >  	while ((p = strchr(p0,'(')) != NULL) {
> >  		++p;
> > -		if((p0 = strchr(p,')')) == NULL)
> > +		p0 = strchr(p, ')');
> > +		if (p0 == NULL)
> >  			return -1;
> >
> >  		size = p0 - p;
> > -		if(size >= sizeof(s))
> > +		if (size >= sizeof(s))
> >  			return -1;
> >
> >  		snprintf(s, sizeof(s), "%.*s", size, p); @@ -3242,15 +3243,15
> @@
> > cmd_config_thresh_parsed(void *parsed_result,
> >
> >  	if (!strcmp(res->name, "txpt"))
> >  		tx_pthresh = res->value;
> > -	else if(!strcmp(res->name, "txht"))
> > +	else if (!strcmp(res->name, "txht"))
> >  		tx_hthresh = res->value;
> > -	else if(!strcmp(res->name, "txwt"))
> > +	else if (!strcmp(res->name, "txwt"))
> >  		tx_wthresh = res->value;
> > -	else if(!strcmp(res->name, "rxpt"))
> > +	else if (!strcmp(res->name, "rxpt"))
> >  		rx_pthresh = res->value;
> > -	else if(!strcmp(res->name, "rxht"))
> > +	else if (!strcmp(res->name, "rxht"))
> >  		rx_hthresh = res->value;
> > -	else if(!strcmp(res->name, "rxwt"))
> > +	else if (!strcmp(res->name, "rxwt"))
> >  		rx_wthresh = res->value;
> >  	else {
> >  		fprintf(stderr, "Unknown parameter\n"); @@ -4088,8 +4089,8
> @@
> > cmd_vlan_offload_parsed(void *parsed_result,
> >  	len = strnlen(str, STR_TOKEN_SIZE);
> >  	i = 0;
> >  	/* Get port_id first */
> > -	while(i < len){
> > -		if(str[i] == ',')
> > +	while (i < len) {
> > +		if (str[i] == ',')
> >  			break;
> >
> >  		i++;
> > @@ -4097,7 +4098,7 @@ cmd_vlan_offload_parsed(void *parsed_result,
> >  	str[i]='\0';
> >  	tmp = strtoul(str, NULL, 0);
> >  	/* If port_id greater that what portid_t can represent, return */
> > -	if(tmp >= RTE_MAX_ETHPORTS)
> > +	if (tmp >= RTE_MAX_ETHPORTS)
> >  		return;
> >  	port_id = (portid_t)tmp;
> >
> > @@ -4108,17 +4109,17 @@ cmd_vlan_offload_parsed(void *parsed_result,
> >
> >  	if (!strcmp(res->what, "strip"))
> >  		rx_vlan_strip_set(port_id,  on);
> > -	else if(!strcmp(res->what, "stripq")){
> > +	else if (!strcmp(res->what, "stripq")) {
> >  		uint16_t queue_id = 0;
> >
> >  		/* No queue_id, return */
> > -		if(i + 1 >= len) {
> > +		if (i + 1 >= len) {
> >  			fprintf(stderr, "must specify (port,queue_id)\n");
> >  			return;
> >  		}
> >  		tmp = strtoul(str + i + 1, NULL, 0);
> >  		/* If queue_id greater that what 16-bits can represent, return */
> > -		if(tmp > 0xffff)
> > +		if (tmp > 0xffff)
> >  			return;
> >
> >  		queue_id = (uint16_t)tmp;
> > @@ -7207,7 +7208,7 @@ static void cmd_mac_addr_parsed(void
> > *parsed_result,
> >  		ret = rte_eth_dev_mac_addr_remove(res->port_num, &res-
> > >address);
> >
> >  	/* check the return value and print it if is < 0 */
> > -	if(ret < 0)
> > +	if (ret < 0)
> >  		fprintf(stderr, "mac_addr_cmd error: (%s)\n", strerror(-ret));
> >
> >  }
> > @@ -7780,7 +7781,7 @@ static void cmd_vf_mac_addr_parsed(void
> > *parsed_result,
> >  						res->vf_num);
> >  #endif
> >
> > -	if(ret < 0)
> > +	if (ret < 0)
> >  		fprintf(stderr, "vf_mac_addr_cmd error: (%s)\n", strerror(-ret));
> >
> >  }
> > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
> > index
> > aed4cdcb8485..7fc6d91f0210 100644
> > --- a/app/test-pmd/parameters.c
> > +++ b/app/test-pmd/parameters.c
> > @@ -306,11 +306,12 @@ parse_portnuma_config(const char *q_arg)
> >  	/* reset from value set at definition */
> >  	while ((p = strchr(p0,'(')) != NULL) {
> >  		++p;
> > -		if((p0 = strchr(p,')')) == NULL)
> > +		p0 = strchr(p, ')');
> > +		if (p0 == NULL)
> >  			return -1;
> >
> >  		size = p0 - p;
> > -		if(size >= sizeof(s))
> > +		if (size >= sizeof(s))
> >  			return -1;
> >
> >  		snprintf(s, sizeof(s), "%.*s", size, p); @@ -366,11 +367,12 @@
> > parse_ringnuma_config(const char *q_arg)
> >  	/* reset from value set at definition */
> >  	while ((p = strchr(p0,'(')) != NULL) {
> >  		++p;
> > -		if((p0 = strchr(p,')')) == NULL)
> > +		p0 = strchr(p, ')');
> > +		if (p0 == NULL)
> >  			return -1;
> >
> >  		size = p0 - p;
> > -		if(size >= sizeof(s))
> > +		if (size >= sizeof(s))
> >  			return -1;
> >
> >  		snprintf(s, sizeof(s), "%.*s", size, p); diff --git a/app/test-
> > pmd/testpmd.c b/app/test-pmd/testpmd.c index
> > aa7ea29f15ba..04b078a2938b
> > 100644
> > --- a/app/test-pmd/testpmd.c
> > +++ b/app/test-pmd/testpmd.c
> > @@ -2406,7 +2406,7 @@ start_packet_forwarding(int with_tx_first)
> >
> >  	test_done = 0;
> >
> > -	if(!no_flush_rx)
> > +	if (!no_flush_rx)
> >  		flush_fwd_rx_queues();
> >
> >  	rxtx_config_display();
> > --
> > 2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* RE: [PATCH v3 13/14] net/i40e: fix whitespace
  2022-11-11  6:23     ` Zhang, Yuying
@ 2022-11-11  7:12       ` Zhang, Yuying
  2022-11-11 16:48       ` Stephen Hemminger
  1 sibling, 0 replies; 52+ messages in thread
From: Zhang, Yuying @ 2022-11-11  7:12 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Xing, Beilei

fix

> -----Original Message-----
> From: Zhang, Yuying
> Sent: 2022年11月11日 14:24
> To: Stephen Hemminger <stephen@networkplumber.org>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>
> Subject: RE: [PATCH v3 13/14] net/i40e: fix whitespace
> 
> Hi,
> 
> Could you add fix line and Cc: stable@dpdk.org?
> The fix looks good to me.
> 
> > -----Original Message-----
> > From: Stephen Hemminger <stephen@networkplumber.org>
> > Sent: 2022年11月10日 7:25
> > To: dev@dpdk.org
> > Cc: Stephen Hemminger <stephen@networkplumber.org>; Zhang, Yuying
> > <yuying.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> > Subject: [PATCH v3 13/14] net/i40e: fix whitespace
> >
> > Add space after keywords.
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Yuying Zhang <yuying.zhang@intel.com>

> > ---
> >  drivers/net/i40e/i40e_pf.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
> > index 15d9ff868f3a..7050e0057d8e 100644
> > --- a/drivers/net/i40e/i40e_pf.c
> > +++ b/drivers/net/i40e/i40e_pf.c
> > @@ -956,7 +956,7 @@ i40e_pf_host_process_cmd_add_vlan(struct
> > i40e_pf_vf *vf,
> >
> >  	for (i = 0; i < vlan_filter_list->num_elements; i++) {
> >  		ret = i40e_vsi_add_vlan(vf->vsi, vid[i]);
> > -		if(ret != I40E_SUCCESS)
> > +		if (ret != I40E_SUCCESS)
> >  			goto send_msg;
> >  	}
> >
> > @@ -996,7 +996,7 @@ i40e_pf_host_process_cmd_del_vlan(struct
> > i40e_pf_vf *vf,
> >  	vid = vlan_filter_list->vlan_id;
> >  	for (i = 0; i < vlan_filter_list->num_elements; i++) {
> >  		ret = i40e_vsi_delete_vlan(vf->vsi, vid[i]);
> > -		if(ret != I40E_SUCCESS)
> > +		if (ret != I40E_SUCCESS)
> >  			goto send_msg;
> >  	}
> >
> > @@ -1577,12 +1577,12 @@ i40e_pf_host_init(struct rte_eth_dev *dev)
> >  	 * return if SRIOV not enabled, VF number not configured or
> >  	 * no queue assigned.
> >  	 */
> > -	if(!hw->func_caps.sr_iov_1_1 || pf->vf_num == 0 || pf->vf_nb_qps == 0)
> > +	if (!hw->func_caps.sr_iov_1_1 || pf->vf_num == 0 || pf->vf_nb_qps ==
> > +0)
> >  		return I40E_SUCCESS;
> >
> >  	/* Allocate memory to store VF structure */
> >  	pf->vfs = rte_zmalloc("i40e_pf_vf",sizeof(*pf->vfs) * pf->vf_num, 0);
> > -	if(pf->vfs == NULL)
> > +	if (pf->vfs == NULL)
> >  		return -ENOMEM;
> >
> >  	/* Disable irq0 for VFR event */
> > --
> > 2.35.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v3 13/14] net/i40e: fix whitespace
  2022-11-11  6:23     ` Zhang, Yuying
  2022-11-11  7:12       ` Zhang, Yuying
@ 2022-11-11 16:48       ` Stephen Hemminger
  1 sibling, 0 replies; 52+ messages in thread
From: Stephen Hemminger @ 2022-11-11 16:48 UTC (permalink / raw)
  To: Zhang, Yuying; +Cc: dev, Xing, Beilei

On Fri, 11 Nov 2022 06:23:31 +0000
"Zhang, Yuying" <yuying.zhang@intel.com> wrote:

> Hi,
> 
> Could you add fix line and Cc: stable@dpdk.org?
> The fix looks good to me.

Whitespace changes don't belong in stable unless they are prerequisite for another change.

^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2022-11-11 16:48 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 19:14 [PATCH 00/14] whitespace around keywords Stephen Hemminger
2022-11-09 19:14 ` [PATCH 01/14] eal: fix whitespace Stephen Hemminger
2022-11-09 19:14 ` [PATCH 02/14] cmdline: " Stephen Hemminger
2022-11-09 19:14 ` [PATCH 03/14] timer: " Stephen Hemminger
2022-11-09 19:14 ` [PATCH 04/14] ip_frag: " Stephen Hemminger
2022-11-09 19:14 ` [PATCH 05/14] testpmd: fix whitspace Stephen Hemminger
2022-11-09 19:14 ` [PATCH 06/14] test: fix whitespace Stephen Hemminger
2022-11-09 19:14 ` [PATCH 07/14] examples/qos_sched: " Stephen Hemminger
2022-11-09 19:28   ` Dumitrescu, Cristian
2022-11-09 19:14 ` [PATCH 08/14] examples/vhost: " Stephen Hemminger
2022-11-09 19:14 ` [PATCH 09/14] l3fwd: " Stephen Hemminger
2022-11-09 19:14 ` [PATCH 10/14] examples: " Stephen Hemminger
2022-11-09 19:14 ` [PATCH 11/14] bus/pci: " Stephen Hemminger
2022-11-09 19:14 ` [PATCH 12/14] net/e1000: " Stephen Hemminger
2022-11-09 19:14 ` [PATCH 13/14] net/i40e: " Stephen Hemminger
2022-11-09 19:14 ` [PATCH 14/14] net/bnx2x: " Stephen Hemminger
2022-11-09 19:53 ` [PATCH v2 00/14] whitespace after keywords Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 01/14] eal: fix whitespace Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 02/14] cmdline: " Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 03/14] timer: " Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 04/14] ip_frag: " Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 05/14] testpmd: " Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 06/14] test: " Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 07/14] examples/qos_sched: " Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 08/14] examples/vhost: " Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 09/14] l3fwd: " Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 10/14] examples: " Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 11/14] bus/pci: " Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 12/14] net/e1000: " Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 13/14] net/i40e: " Stephen Hemminger
2022-11-09 19:53   ` [PATCH v2 14/14] net/bnx2x: " Stephen Hemminger
2022-11-09 23:24 ` [PATCH v3 00/14] whitespace after keywords Stephen Hemminger
2022-11-09 23:24   ` [PATCH v3 01/14] eal: fix whitespace Stephen Hemminger
2022-11-09 23:24   ` [PATCH v3 02/14] cmdline: " Stephen Hemminger
2022-11-09 23:24   ` [PATCH v3 03/14] timer: " Stephen Hemminger
2022-11-09 23:24   ` [PATCH v3 04/14] ip_frag: " Stephen Hemminger
2022-11-09 23:24   ` [PATCH v3 05/14] testpmd: " Stephen Hemminger
2022-11-11  6:30     ` Zhang, Yuying
2022-11-11  7:12       ` Zhang, Yuying
2022-11-09 23:24   ` [PATCH v3 06/14] test: " Stephen Hemminger
2022-11-09 23:24   ` [PATCH v3 07/14] examples/qos_sched: " Stephen Hemminger
2022-11-09 23:24   ` [PATCH v3 08/14] examples/vhost: " Stephen Hemminger
2022-11-10  1:48     ` Xia, Chenbo
2022-11-09 23:24   ` [PATCH v3 09/14] l3fwd: " Stephen Hemminger
2022-11-09 23:24   ` [PATCH v3 10/14] examples: " Stephen Hemminger
2022-11-09 23:24   ` [PATCH v3 11/14] bus/pci: " Stephen Hemminger
2022-11-09 23:24   ` [PATCH v3 12/14] net/e1000: " Stephen Hemminger
2022-11-09 23:24   ` [PATCH v3 13/14] net/i40e: " Stephen Hemminger
2022-11-11  6:23     ` Zhang, Yuying
2022-11-11  7:12       ` Zhang, Yuying
2022-11-11 16:48       ` Stephen Hemminger
2022-11-09 23:24   ` [PATCH v3 14/14] net/bnx2x: " Stephen Hemminger

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