* [PATCH 0/7] space after keyword cleanups
@ 2023-01-16 17:27 Stephen Hemminger
2023-01-16 17:27 ` [PATCH 1/7] test: fix whitespace Stephen Hemminger
` (8 more replies)
0 siblings, 9 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:27 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
These are the results of a script replacing 'if(' with 'if ('
in various places.
Stephen Hemminger (7):
test: fix whitespace
testpmd: fix whitespace
net/e1000: fix whitespace
i40e: fix whitespace
examples: fix whitespace
cmdline: fix whitespace
ip_frag: fix whitespace
app/test-pmd/cmdline.c | 30 +++++++++++-----------
app/test-pmd/parameters.c | 8 +++---
app/test-pmd/testpmd.c | 2 +-
app/test/test_debug.c | 4 +--
app/test/test_hash.c | 6 ++---
app/test/test_malloc.c | 10 ++++----
app/test/test_mbuf.c | 12 ++++-----
app/test/test_spinlock.c | 2 +-
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 8 +++---
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 6 ++---
drivers/net/i40e/i40e_pf.c | 8 +++---
examples/ip_reassembly/main.c | 2 +-
examples/l3fwd-power/main.c | 4 +--
examples/l3fwd/main.c | 4 +--
examples/multi_process/symmetric_mp/main.c | 4 +--
lib/cmdline/cmdline_rdline.c | 6 ++---
lib/ip_frag/rte_ipv4_reassembly.c | 2 +-
19 files changed, 61 insertions(+), 61 deletions(-)
--
2.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 1/7] test: fix whitespace
2023-01-16 17:27 [PATCH 0/7] space after keyword cleanups Stephen Hemminger
@ 2023-01-16 17:27 ` Stephen Hemminger
2023-01-16 17:27 ` [PATCH 2/7] testpmd: " Stephen Hemminger
` (7 subsequent siblings)
8 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:27 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Yipeng Wang, Sameh Gobriel, Bruce Richardson,
Vladimir Medvedkin, Anatoly Burakov, Olivier Matz
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/test_debug.c | 4 ++--
app/test/test_hash.c | 6 +++---
app/test/test_malloc.c | 10 +++++-----
app/test/test_mbuf.c | 12 ++++++------
app/test/test_spinlock.c | 2 +-
5 files changed, 17 insertions(+), 17 deletions(-)
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..39e847530c1a 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -50,7 +50,7 @@ static uint32_t hashtest_key_lens[] = {0, 2, 4, 5, 6, 7, 8, 10, 11, 15, 16, 21,
if (handle) rte_hash_free(handle); \
return -1; \
} \
-} while(0)
+} while (0)
#define RETURN_IF_ERROR_FBK(cond, str, ...) do { \
if (cond) { \
@@ -58,7 +58,7 @@ static uint32_t hashtest_key_lens[] = {0, 2, 4, 5, 6, 7, 8, 10, 11, 15, 16, 21,
if (handle) rte_fbk_hash_free(handle); \
return -1; \
} \
-} while(0)
+} while (0)
#define RETURN_IF_ERROR_RCU_QSBR(cond, str, ...) do { \
if (cond) { \
@@ -728,7 +728,7 @@ static int test_five_keys(void)
key_array[i] = &keys[i];
ret = rte_hash_lookup_bulk(handle, &key_array[0], 5, (int32_t *)pos);
- if(ret == 0)
+ 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],
diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c
index de40e506113a..f28a3f69d4fd 100644
--- a/app/test/test_malloc.c
+++ b/app/test/test_malloc.c
@@ -87,7 +87,7 @@ test_align_overlap_per_lcore(__rte_unused void *arg)
break;
}
for(j = 0; j < 1000 ; j++) {
- if( *(char *)p1 != 0) {
+ if ( *(char *)p1 != 0) {
printf("rte_zmalloc didn't zero the allocated memory\n");
ret = -1;
}
@@ -158,7 +158,7 @@ test_reordered_free_per_lcore(__rte_unused void *arg)
break;
}
for(j = 0; j < 1000 ; j++) {
- if( *(char *)p1 != 0) {
+ 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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 2/7] testpmd: fix whitespace
2023-01-16 17:27 [PATCH 0/7] space after keyword cleanups Stephen Hemminger
2023-01-16 17:27 ` [PATCH 1/7] test: fix whitespace Stephen Hemminger
@ 2023-01-16 17:27 ` Stephen Hemminger
2023-01-16 17:27 ` [PATCH 3/7] net/e1000: " Stephen Hemminger
` (6 subsequent siblings)
8 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:27 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Aman Singh, Yuying Zhang
The style standard is to use blank after keywords.
I.e "if (" not "if("
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 b32dc8bfd445..615a1ea295f7 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");
@@ -4084,8 +4084,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++;
@@ -4093,7 +4093,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;
@@ -4104,17 +4104,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;
@@ -7252,7 +7252,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));
}
@@ -7825,7 +7825,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 d597c209ba5e..e2371cfd7094 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -308,11 +308,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);
@@ -368,11 +368,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 134d79a55547..c38e8fecc50a 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2408,7 +2408,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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 3/7] net/e1000: fix whitespace
2023-01-16 17:27 [PATCH 0/7] space after keyword cleanups Stephen Hemminger
2023-01-16 17:27 ` [PATCH 1/7] test: fix whitespace Stephen Hemminger
2023-01-16 17:27 ` [PATCH 2/7] testpmd: " Stephen Hemminger
@ 2023-01-16 17:27 ` Stephen Hemminger
2023-01-16 17:27 ` [PATCH 4/7] i40e: " Stephen Hemminger
` (5 subsequent siblings)
8 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:27 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Simei Su, Wenjun Wu
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 8 ++++----
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 6 +++---
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 8ee9be12ad19..3cb09538b2df 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -872,7 +872,7 @@ 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 ||
+ 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;
}
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..2d4a1292053e 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -196,13 +196,13 @@ struct igb_tx_queue {
#ifdef RTE_PMD_USE_PREFETCH
#define rte_igb_prefetch(p) rte_prefetch0(p)
#else
-#define rte_igb_prefetch(p) do {} while(0)
+#define rte_igb_prefetch(p) do {} while (0)
#endif
#ifdef RTE_PMD_PACKET_PREFETCH
#define rte_packet_prefetch(p) rte_prefetch1(p)
#else
-#define rte_packet_prefetch(p) do {} while(0)
+#define rte_packet_prefetch(p) do {} while (0)
#endif
/*
@@ -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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 4/7] i40e: fix whitespace
2023-01-16 17:27 [PATCH 0/7] space after keyword cleanups Stephen Hemminger
` (2 preceding siblings ...)
2023-01-16 17:27 ` [PATCH 3/7] net/e1000: " Stephen Hemminger
@ 2023-01-16 17:27 ` Stephen Hemminger
2023-01-16 17:27 ` [PATCH 5/7] examples: " Stephen Hemminger
` (4 subsequent siblings)
8 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:27 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Yuying Zhang, Beilei Xing
The style standard is to use blank after keywords.
I.e "if (" not "if("
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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 5/7] examples: fix whitespace
2023-01-16 17:27 [PATCH 0/7] space after keyword cleanups Stephen Hemminger
` (3 preceding siblings ...)
2023-01-16 17:27 ` [PATCH 4/7] i40e: " Stephen Hemminger
@ 2023-01-16 17:27 ` Stephen Hemminger
2023-01-16 17:27 ` [PATCH 6/7] cmdline: " Stephen Hemminger
` (3 subsequent siblings)
8 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:27 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Konstantin Ananyev, David Hunt, Anatoly Burakov
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/ip_reassembly/main.c | 2 +-
examples/l3fwd-power/main.c | 4 ++--
examples/l3fwd/main.c | 4 ++--
examples/multi_process/symmetric_mp/main.c | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
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/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd3ade330f82..3ef6e5a1ccc6 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);
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 5198ff30dd00..70054183e1bb 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);
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 1ff85875dfdf..8d1119bd8483 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;
@@ -471,7 +471,7 @@ main(int argc, char **argv)
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)
+ 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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 6/7] cmdline: fix whitespace
2023-01-16 17:27 [PATCH 0/7] space after keyword cleanups Stephen Hemminger
` (4 preceding siblings ...)
2023-01-16 17:27 ` [PATCH 5/7] examples: " Stephen Hemminger
@ 2023-01-16 17:27 ` Stephen Hemminger
2023-01-16 17:27 ` [PATCH 7/7] ip_frag: " Stephen Hemminger
` (2 subsequent siblings)
8 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:27 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Olivier Matz
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/cmdline/cmdline_rdline.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 7/7] ip_frag: fix whitespace
2023-01-16 17:27 [PATCH 0/7] space after keyword cleanups Stephen Hemminger
` (5 preceding siblings ...)
2023-01-16 17:27 ` [PATCH 6/7] cmdline: " Stephen Hemminger
@ 2023-01-16 17:27 ` Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 0/7] space after keyword cleanups Stephen Hemminger
2023-01-17 0:14 ` [PATCH v3 0/7] add space after keywords Stephen Hemminger
8 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:27 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Konstantin Ananyev
The style standard is to use blank after keywords.
I.e "if (" not "if("
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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v2 0/7] space after keyword cleanups
2023-01-16 17:27 [PATCH 0/7] space after keyword cleanups Stephen Hemminger
` (6 preceding siblings ...)
2023-01-16 17:27 ` [PATCH 7/7] ip_frag: " Stephen Hemminger
@ 2023-01-16 17:51 ` Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 1/7] test: fix whitespace Stephen Hemminger
` (6 more replies)
2023-01-17 0:14 ` [PATCH v3 0/7] add space after keywords Stephen Hemminger
8 siblings, 7 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:51 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
These are the results of a script replacing 'if(' with 'if ('
in various places.
v2 - fix related style changes on same lines reported
by checkpatch
Stephen Hemminger (7):
test: fix whitespace
testpmd: fix whitespace
net/e1000: fix whitespace
i40e: fix whitespace
examples: fix whitespace
cmdline: fix whitespace
ip_frag: fix whitespace
app/test-pmd/cmdline.c | 33 +++++++++++-----------
app/test-pmd/parameters.c | 11 ++++----
app/test-pmd/testpmd.c | 2 +-
app/test/test_cmdline_cirbuf.c | 4 +--
app/test/test_debug.c | 6 ++--
app/test/test_hash.c | 10 +++----
app/test/test_lpm6_perf.c | 2 +-
app/test/test_malloc.c | 14 ++++-----
app/test/test_mbuf.c | 15 +++++-----
app/test/test_ring_perf.c | 2 +-
app/test/test_spinlock.c | 2 +-
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 16 +++++------
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 6 ++--
drivers/net/i40e/i40e_pf.c | 8 +++---
examples/ip_reassembly/main.c | 2 +-
examples/l3fwd-power/main.c | 7 +++--
examples/l3fwd/main.c | 7 +++--
examples/multi_process/symmetric_mp/main.c | 4 +--
lib/cmdline/cmdline_rdline.c | 12 ++++----
lib/ip_frag/rte_ipv4_reassembly.c | 2 +-
22 files changed, 86 insertions(+), 83 deletions(-)
--
2.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v2 1/7] test: fix whitespace
2023-01-16 17:51 ` [PATCH v2 0/7] space after keyword cleanups Stephen Hemminger
@ 2023-01-16 17:51 ` Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 2/7] testpmd: " Stephen Hemminger
` (5 subsequent siblings)
6 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:51 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Olivier Matz, Yipeng Wang, Sameh Gobriel,
Bruce Richardson, Vladimir Medvedkin, Anatoly Burakov,
Honnappa Nagarahalli, Konstantin Ananyev
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/test_cmdline_cirbuf.c | 4 ++--
app/test/test_debug.c | 6 +++---
app/test/test_hash.c | 10 +++++-----
app/test/test_lpm6_perf.c | 2 +-
app/test/test_malloc.c | 14 +++++++-------
app/test/test_mbuf.c | 15 +++++++--------
app/test/test_ring_perf.c | 2 +-
app/test/test_spinlock.c | 2 +-
8 files changed, 27 insertions(+), 28 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..24f14bd11313 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
@@ -78,13 +78,13 @@ test_exit_val(int exit_val)
if (pid == 0)
rte_exit(exit_val, __func__);
- else if (pid < 0){
+ else if (pid < 0) {
printf("Fork Failed\n");
return -1;
}
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..b1307ce42e6b 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -50,7 +50,7 @@ static uint32_t hashtest_key_lens[] = {0, 2, 4, 5, 6, 7, 8, 10, 11, 15, 16, 21,
if (handle) rte_hash_free(handle); \
return -1; \
} \
-} while(0)
+} while (0)
#define RETURN_IF_ERROR_FBK(cond, str, ...) do { \
if (cond) { \
@@ -58,7 +58,7 @@ static uint32_t hashtest_key_lens[] = {0, 2, 4, 5, 6, 7, 8, 10, 11, 15, 16, 21,
if (handle) rte_fbk_hash_free(handle); \
return -1; \
} \
-} while(0)
+} while (0)
#define RETURN_IF_ERROR_RCU_QSBR(cond, str, ...) do { \
if (cond) { \
@@ -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..0b45749e9b03 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,8 @@ 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 +700,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 +965,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 +1194,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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v2 2/7] testpmd: fix whitespace
2023-01-16 17:51 ` [PATCH v2 0/7] space after keyword cleanups Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 1/7] test: fix whitespace Stephen Hemminger
@ 2023-01-16 17:51 ` Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 3/7] net/e1000: " Stephen Hemminger
` (4 subsequent siblings)
6 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:51 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Aman Singh, Yuying Zhang
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-pmd/cmdline.c | 33 +++++++++++++++++----------------
app/test-pmd/parameters.c | 11 ++++++-----
app/test-pmd/testpmd.c | 2 +-
3 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index b32dc8bfd445..d2a52ac7b723 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2728,13 +2728,14 @@ parse_reta_config(const char *str,
unsigned long int_fld[_NUM_FLD];
char *str_fld[_NUM_FLD];
- while ((p = strchr(p0,'(')) != NULL) {
+ 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");
@@ -4084,8 +4085,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++;
@@ -4093,7 +4094,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;
@@ -4104,17 +4105,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;
@@ -7252,7 +7253,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));
}
@@ -7825,7 +7826,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 d597c209ba5e..5f8f962bc93d 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -306,13 +306,14 @@ parse_portnuma_config(const char *q_arg)
char *str_fld[_NUM_FLD];
/* reset from value set at definition */
- while ((p = strchr(p0,'(')) != NULL) {
+ 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);
@@ -368,11 +369,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 134d79a55547..c38e8fecc50a 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2408,7 +2408,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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v2 3/7] net/e1000: fix whitespace
2023-01-16 17:51 ` [PATCH v2 0/7] space after keyword cleanups Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 1/7] test: fix whitespace Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 2/7] testpmd: " Stephen Hemminger
@ 2023-01-16 17:51 ` Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 4/7] i40e: " Stephen Hemminger
` (3 subsequent siblings)
6 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:51 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Simei Su, Wenjun Wu, Anatoly Burakov
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 16 ++++++++--------
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 6 +++---
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 8ee9be12ad19..3cb09538b2df 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -872,7 +872,7 @@ 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 ||
+ 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..e89bfa248fb0 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -735,7 +735,7 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev)
/* for secondary processes, we don't initialise any further as primary
* has already done this work. Only check we don't need a different
* RX function */
- if (rte_eal_process_type() != RTE_PROC_PRIMARY){
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
if (eth_dev->data->scattered_rx)
eth_dev->rx_pkt_burst = ð_igb_recv_scattered_pkts;
return 0;
@@ -927,7 +927,7 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)
/* for secondary processes, we don't initialise any further as primary
* has already done this work. Only check we don't need a different
* RX function */
- if (rte_eal_process_type() != RTE_PROC_PRIMARY){
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
if (eth_dev->data->scattered_rx)
eth_dev->rx_pkt_burst = ð_igb_recv_scattered_pkts;
return 0;
@@ -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);
@@ -3498,12 +3498,12 @@ static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on)
E1000_DEV_PRIVATE_TO_VFTA(dev->data->dev_private);
int i = 0, j = 0, vfta = 0, mask = 1;
- for (i = 0; i < IGB_VFTA_SIZE; i++){
+ 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)
+ for (j = 0; j < 32; j++) {
+ 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..2d4a1292053e 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -196,13 +196,13 @@ struct igb_tx_queue {
#ifdef RTE_PMD_USE_PREFETCH
#define rte_igb_prefetch(p) rte_prefetch0(p)
#else
-#define rte_igb_prefetch(p) do {} while(0)
+#define rte_igb_prefetch(p) do {} while (0)
#endif
#ifdef RTE_PMD_PACKET_PREFETCH
#define rte_packet_prefetch(p) rte_prefetch1(p)
#else
-#define rte_packet_prefetch(p) do {} while(0)
+#define rte_packet_prefetch(p) do {} while (0)
#endif
/*
@@ -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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v2 4/7] i40e: fix whitespace
2023-01-16 17:51 ` [PATCH v2 0/7] space after keyword cleanups Stephen Hemminger
` (2 preceding siblings ...)
2023-01-16 17:51 ` [PATCH v2 3/7] net/e1000: " Stephen Hemminger
@ 2023-01-16 17:51 ` Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 5/7] examples: " Stephen Hemminger
` (2 subsequent siblings)
6 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:51 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Yuying Zhang, Beilei Xing
The style standard is to use blank after keywords.
I.e "if (" not "if("
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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v2 5/7] examples: fix whitespace
2023-01-16 17:51 ` [PATCH v2 0/7] space after keyword cleanups Stephen Hemminger
` (3 preceding siblings ...)
2023-01-16 17:51 ` [PATCH v2 4/7] i40e: " Stephen Hemminger
@ 2023-01-16 17:51 ` Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 6/7] cmdline: " Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 7/7] ip_frag: " Stephen Hemminger
6 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:51 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Konstantin Ananyev, David Hunt, Anatoly Burakov
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/ip_reassembly/main.c | 2 +-
examples/l3fwd-power/main.c | 7 ++++---
examples/l3fwd/main.c | 7 ++++---
examples/multi_process/symmetric_mp/main.c | 4 ++--
4 files changed, 11 insertions(+), 9 deletions(-)
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/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd3ade330f82..d10102fa282e 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1785,13 +1785,14 @@ parse_config(const char *q_arg)
nb_lcore_params = 0;
- while ((p = strchr(p0,'(')) != NULL) {
+ 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/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 5198ff30dd00..e2bdfe451a2c 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -514,13 +514,14 @@ parse_config(const char *q_arg)
nb_lcore_params = 0;
- while ((p = strchr(p0,'(')) != NULL) {
+ 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/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 1ff85875dfdf..8d1119bd8483 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;
@@ -471,7 +471,7 @@ main(int argc, char **argv)
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)
+ 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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v2 6/7] cmdline: fix whitespace
2023-01-16 17:51 ` [PATCH v2 0/7] space after keyword cleanups Stephen Hemminger
` (4 preceding siblings ...)
2023-01-16 17:51 ` [PATCH v2 5/7] examples: " Stephen Hemminger
@ 2023-01-16 17:51 ` Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 7/7] ip_frag: " Stephen Hemminger
6 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:51 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Olivier Matz
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/cmdline/cmdline_rdline.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/cmdline/cmdline_rdline.c b/lib/cmdline/cmdline_rdline.c
index 5cf723a0126a..1ceba6b0b8d4 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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v2 7/7] ip_frag: fix whitespace
2023-01-16 17:51 ` [PATCH v2 0/7] space after keyword cleanups Stephen Hemminger
` (5 preceding siblings ...)
2023-01-16 17:51 ` [PATCH v2 6/7] cmdline: " Stephen Hemminger
@ 2023-01-16 17:51 ` Stephen Hemminger
6 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-16 17:51 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Konstantin Ananyev
The style standard is to use blank after keywords.
I.e "if (" not "if("
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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v3 0/7] add space after keywords
2023-01-16 17:27 [PATCH 0/7] space after keyword cleanups Stephen Hemminger
` (7 preceding siblings ...)
2023-01-16 17:51 ` [PATCH v2 0/7] space after keyword cleanups Stephen Hemminger
@ 2023-01-17 0:14 ` Stephen Hemminger
2023-01-17 0:14 ` [PATCH v3 1/7] test: fix whitespace Stephen Hemminger
` (7 more replies)
8 siblings, 8 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-17 0:14 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
These are the results of a script replacing 'if(' with 'if ('
in various places.
v3 - more checkpatch fallout
also fix places where 'for(' is used.
Stephen Hemminger (7):
test: fix whitespace
testpmd: fix whitespace
net/e1000: fix whitespace
i40e: fix whitespace
examples: fix whitespace
cmdline: fix whitespace
ip_frag: fix whitespace
app/test-pmd/cmdline.c | 33 +++++++++++-----------
app/test-pmd/parameters.c | 12 ++++----
app/test-pmd/testpmd.c | 2 +-
app/test/test_cmdline_cirbuf.c | 4 +--
app/test/test_debug.c | 6 ++--
app/test/test_hash.c | 10 +++----
app/test/test_lpm6_perf.c | 2 +-
app/test/test_malloc.c | 14 ++++-----
app/test/test_mbuf.c | 15 +++++-----
app/test/test_ring_perf.c | 2 +-
app/test/test_spinlock.c | 2 +-
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 16 +++++------
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 6 ++--
drivers/net/i40e/i40e_pf.c | 8 +++---
examples/ip_reassembly/main.c | 2 +-
examples/l3fwd-power/main.c | 9 +++---
examples/l3fwd/main.c | 9 +++---
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 | 2 +-
lib/cmdline/cmdline_rdline.c | 12 ++++----
lib/ip_frag/rte_ipv4_reassembly.c | 2 +-
26 files changed, 96 insertions(+), 92 deletions(-)
--
2.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v3 1/7] test: fix whitespace
2023-01-17 0:14 ` [PATCH v3 0/7] add space after keywords Stephen Hemminger
@ 2023-01-17 0:14 ` Stephen Hemminger
2023-01-17 0:14 ` [PATCH v3 2/7] testpmd: " Stephen Hemminger
` (6 subsequent siblings)
7 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-17 0:14 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Olivier Matz, Yipeng Wang, Sameh Gobriel,
Bruce Richardson, Vladimir Medvedkin, Anatoly Burakov,
Honnappa Nagarahalli, Konstantin Ananyev
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/test_cmdline_cirbuf.c | 4 ++--
app/test/test_debug.c | 6 +++---
app/test/test_hash.c | 10 +++++-----
app/test/test_lpm6_perf.c | 2 +-
app/test/test_malloc.c | 14 +++++++-------
app/test/test_mbuf.c | 15 +++++++--------
app/test/test_ring_perf.c | 2 +-
app/test/test_spinlock.c | 2 +-
8 files changed, 27 insertions(+), 28 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..24f14bd11313 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
@@ -78,13 +78,13 @@ test_exit_val(int exit_val)
if (pid == 0)
rte_exit(exit_val, __func__);
- else if (pid < 0){
+ else if (pid < 0) {
printf("Fork Failed\n");
return -1;
}
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..b1307ce42e6b 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -50,7 +50,7 @@ static uint32_t hashtest_key_lens[] = {0, 2, 4, 5, 6, 7, 8, 10, 11, 15, 16, 21,
if (handle) rte_hash_free(handle); \
return -1; \
} \
-} while(0)
+} while (0)
#define RETURN_IF_ERROR_FBK(cond, str, ...) do { \
if (cond) { \
@@ -58,7 +58,7 @@ static uint32_t hashtest_key_lens[] = {0, 2, 4, 5, 6, 7, 8, 10, 11, 15, 16, 21,
if (handle) rte_fbk_hash_free(handle); \
return -1; \
} \
-} while(0)
+} while (0)
#define RETURN_IF_ERROR_RCU_QSBR(cond, str, ...) do { \
if (cond) { \
@@ -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..0b45749e9b03 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,8 @@ 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 +700,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 +965,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 +1194,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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v3 2/7] testpmd: fix whitespace
2023-01-17 0:14 ` [PATCH v3 0/7] add space after keywords Stephen Hemminger
2023-01-17 0:14 ` [PATCH v3 1/7] test: fix whitespace Stephen Hemminger
@ 2023-01-17 0:14 ` Stephen Hemminger
2023-01-31 8:21 ` Singh, Aman Deep
2023-01-17 0:14 ` [PATCH v3 3/7] net/e1000: " Stephen Hemminger
` (5 subsequent siblings)
7 siblings, 1 reply; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-17 0:14 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Aman Singh, Yuying Zhang
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-pmd/cmdline.c | 33 +++++++++++++++++----------------
app/test-pmd/parameters.c | 12 +++++++-----
app/test-pmd/testpmd.c | 2 +-
3 files changed, 25 insertions(+), 22 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index b32dc8bfd445..d2a52ac7b723 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2728,13 +2728,14 @@ parse_reta_config(const char *str,
unsigned long int_fld[_NUM_FLD];
char *str_fld[_NUM_FLD];
- while ((p = strchr(p0,'(')) != NULL) {
+ 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");
@@ -4084,8 +4085,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++;
@@ -4093,7 +4094,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;
@@ -4104,17 +4105,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;
@@ -7252,7 +7253,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));
}
@@ -7825,7 +7826,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 d597c209ba5e..1e619db64891 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -306,13 +306,14 @@ parse_portnuma_config(const char *q_arg)
char *str_fld[_NUM_FLD];
/* reset from value set at definition */
- while ((p = strchr(p0,'(')) != NULL) {
+ 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);
@@ -368,11 +369,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 134d79a55547..c38e8fecc50a 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2408,7 +2408,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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v3 3/7] net/e1000: fix whitespace
2023-01-17 0:14 ` [PATCH v3 0/7] add space after keywords Stephen Hemminger
2023-01-17 0:14 ` [PATCH v3 1/7] test: fix whitespace Stephen Hemminger
2023-01-17 0:14 ` [PATCH v3 2/7] testpmd: " Stephen Hemminger
@ 2023-01-17 0:14 ` Stephen Hemminger
2023-01-17 1:21 ` Wu, Wenjun1
2023-01-17 1:26 ` Su, Simei
2023-01-17 0:14 ` [PATCH v3 4/7] i40e: " Stephen Hemminger
` (4 subsequent siblings)
7 siblings, 2 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-17 0:14 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Simei Su, Wenjun Wu, Anatoly Burakov
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 16 ++++++++--------
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 6 +++---
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 8ee9be12ad19..3cb09538b2df 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -872,7 +872,7 @@ 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 ||
+ 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..e89bfa248fb0 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -735,7 +735,7 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev)
/* for secondary processes, we don't initialise any further as primary
* has already done this work. Only check we don't need a different
* RX function */
- if (rte_eal_process_type() != RTE_PROC_PRIMARY){
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
if (eth_dev->data->scattered_rx)
eth_dev->rx_pkt_burst = ð_igb_recv_scattered_pkts;
return 0;
@@ -927,7 +927,7 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)
/* for secondary processes, we don't initialise any further as primary
* has already done this work. Only check we don't need a different
* RX function */
- if (rte_eal_process_type() != RTE_PROC_PRIMARY){
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
if (eth_dev->data->scattered_rx)
eth_dev->rx_pkt_burst = ð_igb_recv_scattered_pkts;
return 0;
@@ -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);
@@ -3498,12 +3498,12 @@ static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on)
E1000_DEV_PRIVATE_TO_VFTA(dev->data->dev_private);
int i = 0, j = 0, vfta = 0, mask = 1;
- for (i = 0; i < IGB_VFTA_SIZE; i++){
+ 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)
+ for (j = 0; j < 32; j++) {
+ 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..2d4a1292053e 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -196,13 +196,13 @@ struct igb_tx_queue {
#ifdef RTE_PMD_USE_PREFETCH
#define rte_igb_prefetch(p) rte_prefetch0(p)
#else
-#define rte_igb_prefetch(p) do {} while(0)
+#define rte_igb_prefetch(p) do {} while (0)
#endif
#ifdef RTE_PMD_PACKET_PREFETCH
#define rte_packet_prefetch(p) rte_prefetch1(p)
#else
-#define rte_packet_prefetch(p) do {} while(0)
+#define rte_packet_prefetch(p) do {} while (0)
#endif
/*
@@ -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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v3 4/7] i40e: fix whitespace
2023-01-17 0:14 ` [PATCH v3 0/7] add space after keywords Stephen Hemminger
` (2 preceding siblings ...)
2023-01-17 0:14 ` [PATCH v3 3/7] net/e1000: " Stephen Hemminger
@ 2023-01-17 0:14 ` Stephen Hemminger
2023-01-17 0:26 ` Xing, Beilei
2023-01-17 0:14 ` [PATCH v3 5/7] examples: " Stephen Hemminger
` (3 subsequent siblings)
7 siblings, 1 reply; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-17 0:14 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Yuying Zhang, Beilei Xing
The style standard is to use blank after keywords.
I.e "if (" not "if("
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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v3 5/7] examples: fix whitespace
2023-01-17 0:14 ` [PATCH v3 0/7] add space after keywords Stephen Hemminger
` (3 preceding siblings ...)
2023-01-17 0:14 ` [PATCH v3 4/7] i40e: " Stephen Hemminger
@ 2023-01-17 0:14 ` Stephen Hemminger
2023-01-17 0:14 ` [PATCH v3 6/7] cmdline: " Stephen Hemminger
` (2 subsequent siblings)
7 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-17 0:14 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Konstantin Ananyev, David Hunt,
Anatoly Burakov, Cristian Dumitrescu
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/ip_reassembly/main.c | 2 +-
examples/l3fwd-power/main.c | 9 +++++----
examples/l3fwd/main.c | 9 +++++----
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 | 2 +-
8 files changed, 20 insertions(+), 18 deletions(-)
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/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd3ade330f82..513a1b21a69e 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1785,13 +1785,14 @@ parse_config(const char *q_arg)
nb_lcore_params = 0;
- while ((p = strchr(p0,'(')) != NULL) {
+ 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..687a81892aad 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -514,13 +514,14 @@ parse_config(const char *q_arg)
nb_lcore_params = 0;
- while ((p = strchr(p0,'(')) != NULL) {
+ 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;
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");
}
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..366f9125268c 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);
--
2.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v3 6/7] cmdline: fix whitespace
2023-01-17 0:14 ` [PATCH v3 0/7] add space after keywords Stephen Hemminger
` (4 preceding siblings ...)
2023-01-17 0:14 ` [PATCH v3 5/7] examples: " Stephen Hemminger
@ 2023-01-17 0:14 ` Stephen Hemminger
2023-01-17 0:14 ` [PATCH v3 7/7] ip_frag: " Stephen Hemminger
2023-03-12 11:28 ` [PATCH v3 0/7] add space after keywords Thomas Monjalon
7 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-17 0:14 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Olivier Matz
The style standard is to use blank after keywords.
I.e "if (" not "if("
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/cmdline/cmdline_rdline.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/cmdline/cmdline_rdline.c b/lib/cmdline/cmdline_rdline.c
index 5cf723a0126a..1ceba6b0b8d4 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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v3 7/7] ip_frag: fix whitespace
2023-01-17 0:14 ` [PATCH v3 0/7] add space after keywords Stephen Hemminger
` (5 preceding siblings ...)
2023-01-17 0:14 ` [PATCH v3 6/7] cmdline: " Stephen Hemminger
@ 2023-01-17 0:14 ` Stephen Hemminger
2023-01-22 16:00 ` Konstantin Ananyev
2023-03-12 11:28 ` [PATCH v3 0/7] add space after keywords Thomas Monjalon
7 siblings, 1 reply; 32+ messages in thread
From: Stephen Hemminger @ 2023-01-17 0:14 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Konstantin Ananyev
The style standard is to use blank after keywords.
I.e "if (" not "if("
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.39.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* RE: [PATCH v3 4/7] i40e: fix whitespace
2023-01-17 0:14 ` [PATCH v3 4/7] i40e: " Stephen Hemminger
@ 2023-01-17 0:26 ` Xing, Beilei
0 siblings, 0 replies; 32+ messages in thread
From: Xing, Beilei @ 2023-01-17 0:26 UTC (permalink / raw)
To: Stephen Hemminger, dev; +Cc: Zhang, Yuying
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Tuesday, January 17, 2023 8:15 AM
> 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 4/7] i40e: fix whitespace
>
> The style standard is to use blank after keywords.
> I.e "if (" not "if("
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Beilei Xing <beilei.xing@intel.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* RE: [PATCH v3 3/7] net/e1000: fix whitespace
2023-01-17 0:14 ` [PATCH v3 3/7] net/e1000: " Stephen Hemminger
@ 2023-01-17 1:21 ` Wu, Wenjun1
2023-01-17 1:26 ` Su, Simei
1 sibling, 0 replies; 32+ messages in thread
From: Wu, Wenjun1 @ 2023-01-17 1:21 UTC (permalink / raw)
To: Stephen Hemminger, dev; +Cc: Su, Simei, Burakov, Anatoly
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Tuesday, January 17, 2023 8:15 AM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Su, Simei
> <simei.su@intel.com>; Wu, Wenjun1 <wenjun1.wu@intel.com>; Burakov,
> Anatoly <anatoly.burakov@intel.com>
> Subject: [PATCH v3 3/7] net/e1000: fix whitespace
>
> The style standard is to use blank after keywords.
> I.e "if (" not "if("
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* RE: [PATCH v3 3/7] net/e1000: fix whitespace
2023-01-17 0:14 ` [PATCH v3 3/7] net/e1000: " Stephen Hemminger
2023-01-17 1:21 ` Wu, Wenjun1
@ 2023-01-17 1:26 ` Su, Simei
1 sibling, 0 replies; 32+ messages in thread
From: Su, Simei @ 2023-01-17 1:26 UTC (permalink / raw)
To: Stephen Hemminger, dev; +Cc: Wu, Wenjun1, Burakov, Anatoly
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Tuesday, January 17, 2023 8:15 AM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Su, Simei
> <simei.su@intel.com>; Wu, Wenjun1 <wenjun1.wu@intel.com>; Burakov,
> Anatoly <anatoly.burakov@intel.com>
> Subject: [PATCH v3 3/7] net/e1000: fix whitespace
>
> The style standard is to use blank after keywords.
> I.e "if (" not "if("
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> drivers/net/e1000/em_ethdev.c | 2 +-
> drivers/net/e1000/igb_ethdev.c | 16 ++++++++--------
> drivers/net/e1000/igb_pf.c | 2 +-
> drivers/net/e1000/igb_rxtx.c | 6 +++---
> 4 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
> index 8ee9be12ad19..3cb09538b2df 100644
> --- a/drivers/net/e1000/em_ethdev.c
> +++ b/drivers/net/e1000/em_ethdev.c
> @@ -872,7 +872,7 @@ 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 ||
> + 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..e89bfa248fb0 100644
> --- a/drivers/net/e1000/igb_ethdev.c
> +++ b/drivers/net/e1000/igb_ethdev.c
> @@ -735,7 +735,7 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev)
> /* for secondary processes, we don't initialise any further as primary
> * has already done this work. Only check we don't need a different
> * RX function */
> - if (rte_eal_process_type() != RTE_PROC_PRIMARY){
> + if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
> if (eth_dev->data->scattered_rx)
> eth_dev->rx_pkt_burst = ð_igb_recv_scattered_pkts;
> return 0;
> @@ -927,7 +927,7 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)
> /* for secondary processes, we don't initialise any further as primary
> * has already done this work. Only check we don't need a different
> * RX function */
> - if (rte_eal_process_type() != RTE_PROC_PRIMARY){
> + if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
> if (eth_dev->data->scattered_rx)
> eth_dev->rx_pkt_burst = ð_igb_recv_scattered_pkts;
> return 0;
> @@ -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); @@ -3498,12
> +3498,12 @@ static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on)
> E1000_DEV_PRIVATE_TO_VFTA(dev->data->dev_private);
> int i = 0, j = 0, vfta = 0, mask = 1;
>
> - for (i = 0; i < IGB_VFTA_SIZE; i++){
> + 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)
> + for (j = 0; j < 32; j++) {
> + 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..2d4a1292053e 100644
> --- a/drivers/net/e1000/igb_rxtx.c
> +++ b/drivers/net/e1000/igb_rxtx.c
> @@ -196,13 +196,13 @@ struct igb_tx_queue { #ifdef
> RTE_PMD_USE_PREFETCH
> #define rte_igb_prefetch(p) rte_prefetch0(p)
> #else
> -#define rte_igb_prefetch(p) do {} while(0)
> +#define rte_igb_prefetch(p) do {} while (0)
> #endif
>
> #ifdef RTE_PMD_PACKET_PREFETCH
> #define rte_packet_prefetch(p) rte_prefetch1(p) #else
> -#define rte_packet_prefetch(p) do {} while(0)
> +#define rte_packet_prefetch(p) do {} while (0)
> #endif
>
> /*
> @@ -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.39.0
Acked-by: Simei Su <simei.su@intel.com>
Thanks
Simei
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH v3 7/7] ip_frag: fix whitespace
2023-01-17 0:14 ` [PATCH v3 7/7] ip_frag: " Stephen Hemminger
@ 2023-01-22 16:00 ` Konstantin Ananyev
0 siblings, 0 replies; 32+ messages in thread
From: Konstantin Ananyev @ 2023-01-22 16:00 UTC (permalink / raw)
To: Stephen Hemminger, dev
17/01/2023 00:14, Stephen Hemminger пишет:
> The style standard is to use blank after keywords.
> I.e "if (" not "if("
>
> 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);
>
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH v3 2/7] testpmd: fix whitespace
2023-01-17 0:14 ` [PATCH v3 2/7] testpmd: " Stephen Hemminger
@ 2023-01-31 8:21 ` Singh, Aman Deep
0 siblings, 0 replies; 32+ messages in thread
From: Singh, Aman Deep @ 2023-01-31 8:21 UTC (permalink / raw)
To: Stephen Hemminger, dev; +Cc: Yuying Zhang
On 1/17/2023 5:44 AM, Stephen Hemminger wrote:
> The style standard is to use blank after keywords.
> I.e "if (" not "if("
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
<snip>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH v3 0/7] add space after keywords
2023-01-17 0:14 ` [PATCH v3 0/7] add space after keywords Stephen Hemminger
` (6 preceding siblings ...)
2023-01-17 0:14 ` [PATCH v3 7/7] ip_frag: " Stephen Hemminger
@ 2023-03-12 11:28 ` Thomas Monjalon
2023-03-14 18:06 ` Stephen Hemminger
7 siblings, 1 reply; 32+ messages in thread
From: Thomas Monjalon @ 2023-03-12 11:28 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
17/01/2023 01:14, Stephen Hemminger:
> Stephen Hemminger (7):
> test: fix whitespace
> testpmd: fix whitespace
> net/e1000: fix whitespace
> i40e: fix whitespace
> examples: fix whitespace
> cmdline: fix whitespace
> ip_frag: fix whitespace
Why these patches are marked as rejected in patchwork?
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH v3 0/7] add space after keywords
2023-03-12 11:28 ` [PATCH v3 0/7] add space after keywords Thomas Monjalon
@ 2023-03-14 18:06 ` Stephen Hemminger
2023-03-14 18:17 ` Thomas Monjalon
0 siblings, 1 reply; 32+ messages in thread
From: Stephen Hemminger @ 2023-03-14 18:06 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Sun, 12 Mar 2023 12:28:22 +0100
Thomas Monjalon <thomas@monjalon.net> wrote:
> 17/01/2023 01:14, Stephen Hemminger:
> > Stephen Hemminger (7):
> > test: fix whitespace
> > testpmd: fix whitespace
> > net/e1000: fix whitespace
> > i40e: fix whitespace
> > examples: fix whitespace
> > cmdline: fix whitespace
> > ip_frag: fix whitespace
>
> Why these patches are marked as rejected in patchwork?
>
>
I marked them as rejected since there were so many other patches
that were more important. Plan to redo similar pass over all of
DPDK by using clang format to look for all whitespace issues.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH v3 0/7] add space after keywords
2023-03-14 18:06 ` Stephen Hemminger
@ 2023-03-14 18:17 ` Thomas Monjalon
0 siblings, 0 replies; 32+ messages in thread
From: Thomas Monjalon @ 2023-03-14 18:17 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
14/03/2023 19:06, Stephen Hemminger:
> On Sun, 12 Mar 2023 12:28:22 +0100
> Thomas Monjalon <thomas@monjalon.net> wrote:
>
> > 17/01/2023 01:14, Stephen Hemminger:
> > > Stephen Hemminger (7):
> > > test: fix whitespace
> > > testpmd: fix whitespace
> > > net/e1000: fix whitespace
> > > i40e: fix whitespace
> > > examples: fix whitespace
> > > cmdline: fix whitespace
> > > ip_frag: fix whitespace
> >
> > Why these patches are marked as rejected in patchwork?
> >
> >
>
> I marked them as rejected since there were so many other patches
> that were more important. Plan to redo similar pass over all of
> DPDK by using clang format to look for all whitespace issues.
OK, you can probably squash all in one patch.
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2023-03-14 18:17 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-16 17:27 [PATCH 0/7] space after keyword cleanups Stephen Hemminger
2023-01-16 17:27 ` [PATCH 1/7] test: fix whitespace Stephen Hemminger
2023-01-16 17:27 ` [PATCH 2/7] testpmd: " Stephen Hemminger
2023-01-16 17:27 ` [PATCH 3/7] net/e1000: " Stephen Hemminger
2023-01-16 17:27 ` [PATCH 4/7] i40e: " Stephen Hemminger
2023-01-16 17:27 ` [PATCH 5/7] examples: " Stephen Hemminger
2023-01-16 17:27 ` [PATCH 6/7] cmdline: " Stephen Hemminger
2023-01-16 17:27 ` [PATCH 7/7] ip_frag: " Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 0/7] space after keyword cleanups Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 1/7] test: fix whitespace Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 2/7] testpmd: " Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 3/7] net/e1000: " Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 4/7] i40e: " Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 5/7] examples: " Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 6/7] cmdline: " Stephen Hemminger
2023-01-16 17:51 ` [PATCH v2 7/7] ip_frag: " Stephen Hemminger
2023-01-17 0:14 ` [PATCH v3 0/7] add space after keywords Stephen Hemminger
2023-01-17 0:14 ` [PATCH v3 1/7] test: fix whitespace Stephen Hemminger
2023-01-17 0:14 ` [PATCH v3 2/7] testpmd: " Stephen Hemminger
2023-01-31 8:21 ` Singh, Aman Deep
2023-01-17 0:14 ` [PATCH v3 3/7] net/e1000: " Stephen Hemminger
2023-01-17 1:21 ` Wu, Wenjun1
2023-01-17 1:26 ` Su, Simei
2023-01-17 0:14 ` [PATCH v3 4/7] i40e: " Stephen Hemminger
2023-01-17 0:26 ` Xing, Beilei
2023-01-17 0:14 ` [PATCH v3 5/7] examples: " Stephen Hemminger
2023-01-17 0:14 ` [PATCH v3 6/7] cmdline: " Stephen Hemminger
2023-01-17 0:14 ` [PATCH v3 7/7] ip_frag: " Stephen Hemminger
2023-01-22 16:00 ` Konstantin Ananyev
2023-03-12 11:28 ` [PATCH v3 0/7] add space after keywords Thomas Monjalon
2023-03-14 18:06 ` Stephen Hemminger
2023-03-14 18:17 ` Thomas Monjalon
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).