Subject: [PATCH iproute2-next 07/10] rdma: Get rid of dev_map_free call

From: Leon Romanovsky <[email-masked]>
Date: Wed, 27 Dec 2017 09:57:56 +0200

From: Leon Romanovsky <[email-masked]>

The dev_map_free() is called once only and it is short,
so it is better to integrate it into the caller's site.

Signed-off-by: Leon Romanovsky <[email-masked]>
---
 rdma/utils.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/rdma/utils.c b/rdma/utils.c
index 998a178d..c1069967 100644
--- a/rdma/utils.c
+++ b/rdma/utils.c
@@ -71,15 +71,6 @@ static struct dev_map *dev_map_alloc(const char *dev_name)
 	return dev_map;
 }
 
-static void dev_map_free(struct dev_map *dev_map)
-{
-	if (!dev_map)
-		return;
-
-	free(dev_map->dev_name);
-	free(dev_map);
-}
-
 static void dev_map_cleanup(struct rd *rd)
 {
 	struct dev_map *dev_map, *tmp;
@@ -87,7 +78,8 @@ static void dev_map_cleanup(struct rd *rd)
 	list_for_each_entry_safe(dev_map, tmp,
 				 &rd->dev_map_list, list) {
 		list_del(&dev_map->list);
-		dev_map_free(dev_map);
+		free(dev_map->dev_name);
+		free(dev_map);
 	}
 }
 
-- 
2.15.1