This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 19ec0b4fe321448049c3605027697b1fe64f45b9
Author: Xiang Xiao <[email protected]>
AuthorDate: Sat Mar 12 12:39:09 2022 +0800

    net/route: Remove net_init_fileroute
    
    Signed-off-by: Xiang Xiao <[email protected]>
---
 net/route/fileroute.h     | 19 -------------------
 net/route/net_fileroute.c | 34 ++--------------------------------
 net/route/net_initroute.c |  5 -----
 3 files changed, 2 insertions(+), 56 deletions(-)

diff --git a/net/route/fileroute.h b/net/route/fileroute.h
index 3eb5f29..454aaa6 100644
--- a/net/route/fileroute.h
+++ b/net/route/fileroute.h
@@ -47,25 +47,6 @@
 struct file; /* Forward reference */
 
 /****************************************************************************
- * Name: net_init_fileroute
- *
- * Description:
- *   Initialize the in-memory, RAM routing table
- *
- * Input Parameters:
- *   None
- *
- * Returned Value:
- *   None
- *
- * Assumptions:
- *   Called early in initialization so that no special protection is needed.
- *
- ****************************************************************************/
-
-void net_init_fileroute(void);
-
-/****************************************************************************
  * Name: net_openroute_ipv4/net_openroute_ipv6
  *
  * Description:
diff --git a/net/route/net_fileroute.c b/net/route/net_fileroute.c
index 739c0fd..e9ff85a 100644
--- a/net/route/net_fileroute.c
+++ b/net/route/net_fileroute.c
@@ -56,7 +56,7 @@
 #ifdef CONFIG_ROUTE_IPv4_FILEROUTE
 /* Semaphore used to lock a routing table for exclusive write-only access */
 
-static sem_t g_ipv4_exclsem;
+static sem_t g_ipv4_exclsem = SEM_INITIALIZER(1);
 static pid_t g_ipv4_holder = NO_HOLDER;
 static int g_ipv4_count;
 #endif
@@ -64,7 +64,7 @@ static int g_ipv4_count;
 #ifdef CONFIG_ROUTE_IPv6_FILEROUTE
 /* Semaphore used to lock a routing table for exclusive write-only access */
 
-static sem_t g_ipv6_exclsem;
+static sem_t g_ipv6_exclsem = SEM_INITIALIZER(1);
 static pid_t g_ipv6_holder = NO_HOLDER;
 static int g_ipv6_count;
 #endif
@@ -181,36 +181,6 @@ int net_routesize(FAR const char *path, size_t entrysize)
  ****************************************************************************/
 
 /****************************************************************************
- * Name: net_init_fileroute
- *
- * Description:
- *   Initialize the in-memory, RAM routing table
- *
- * Input Parameters:
- *   None
- *
- * Returned Value:
- *   None
- *
- * Assumptions:
- *   Called early in initialization so that no special protection is needed.
- *
- ****************************************************************************/
-
-void net_init_fileroute(void)
-{
-  /* Initialize semaphores */
-
-#ifdef CONFIG_ROUTE_IPv4_FILEROUTE
-  nxsem_init(&g_ipv4_exclsem, 0, 1);
-#endif
-
-#ifdef CONFIG_ROUTE_IPv6_FILEROUTE
-  nxsem_init(&g_ipv6_exclsem, 0, 1);
-#endif
-}
-
-/****************************************************************************
  * Name: net_openroute_ipv4/net_openroute_ipv6
  *
  * Description:
diff --git a/net/route/net_initroute.c b/net/route/net_initroute.c
index be66f3a..7af4464 100644
--- a/net/route/net_initroute.c
+++ b/net/route/net_initroute.c
@@ -25,7 +25,6 @@
 #include <nuttx/config.h>
 
 #include "route/ramroute.h"
-#include "route/fileroute.h"
 #include "route/cacheroute.h"
 #include "route/route.h"
 
@@ -55,10 +54,6 @@ void net_init_route(void)
   net_init_ramroute();
 #endif
 
-#if defined(CONFIG_ROUTE_IPv4_FILEROUTE) || 
defined(CONFIG_ROUTE_IPv6_FILEROUTE)
-  net_init_fileroute();
-#endif
-
 #if defined(CONFIG_ROUTE_IPv4_CACHEROUTE) || 
defined(CONFIG_ROUTE_IPv6_CACHEROUTE)
   net_init_cacheroute();
 #endif

Reply via email to