[dpdk-dev,2/2] sched/malloc: remove unnecesary return statements

Message ID 20161208014751.24285-3-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
checkpatch/checkpatch success coding style OK

Commit Message

Stephen Hemminger Dec. 8, 2016, 1:47 a.m. UTC
  return statements at end of void functions are unnecessary and unwanted.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
 lib/librte_eal/common/rte_malloc.c     | 1 -
 lib/librte_sched/rte_bitmap.h          | 2 --
 3 files changed, 1 insertion(+), 4 deletions(-)
  

Comments

Ferruh Yigit Dec. 8, 2016, 10:33 a.m. UTC | #1
On 12/8/2016 1:47 AM, Stephen Hemminger wrote:
> return statements at end of void functions are unnecessary and unwanted.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

But patch content is not just for sched/malloc as title suggests, it has
sched:
mem:
net/bonding:
  

Patch

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index a80b6fa..05afcee 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -241,8 +241,8 @@  arp_op_name(uint16_t arp_op, char *buf)
 	default:
 		break;
 	}
+
 	snprintf(buf, sizeof("Unknown"), "%s", "Unknown");
-	return;
 }
 #endif
 #define MaxIPv4String	16
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index f4a8835..09970b0 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -232,7 +232,6 @@  rte_malloc_dump_stats(FILE *f, __rte_unused const char *type)
 		fprintf(f, "\tAlloc_count:%u,\n",sock_stats.alloc_count);
 		fprintf(f, "\tFree_count:%u,\n", sock_stats.free_count);
 	}
-	return;
 }
 
 /*
diff --git a/lib/librte_sched/rte_bitmap.h b/lib/librte_sched/rte_bitmap.h
index 010d752..d432fdf 100644
--- a/lib/librte_sched/rte_bitmap.h
+++ b/lib/librte_sched/rte_bitmap.h
@@ -453,8 +453,6 @@  rte_bitmap_clear(struct rte_bitmap *bmp, uint32_t pos)
 	offset1 = (pos >> RTE_BITMAP_CL_BIT_SIZE_LOG2) & RTE_BITMAP_SLAB_BIT_MASK;
 	slab1 = bmp->array1 + index1;
 	*slab1 &= ~(1lu << offset1);
-
-	return;
 }
 
 static inline int