[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230601172145.51357-5-stephen@networkplumber.org>
Date: Thu, 1 Jun 2023 10:21:42 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2 4/7] rt_names: drop unused rtnl_addrprot_a2n
This function is defined but never used in current code.
Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
include/rt_names.h | 1 -
lib/rt_names.c | 33 ---------------------------------
2 files changed, 34 deletions(-)
diff --git a/include/rt_names.h b/include/rt_names.h
index e96d80f30554..9003e67785b3 100644
--- a/include/rt_names.h
+++ b/include/rt_names.h
@@ -14,7 +14,6 @@ const char *rtnl_dsfield_get_name(int id);
const char *rtnl_group_n2a(int id, char *buf, int len);
int rtnl_rtprot_a2n(__u32 *id, const char *arg);
-int rtnl_addrprot_a2n(__u32 *id, const char *arg);
int rtnl_rtscope_a2n(__u32 *id, const char *arg);
int rtnl_rttable_a2n(__u32 *id, const char *arg);
int rtnl_rtrealm_a2n(__u32 *id, const char *arg);
diff --git a/lib/rt_names.c b/lib/rt_names.c
index 51d11fd056b1..8af3bca3245b 100644
--- a/lib/rt_names.c
+++ b/lib/rt_names.c
@@ -255,39 +255,6 @@ numeric:
return buf;
}
-int rtnl_addrprot_a2n(__u32 *id, const char *arg)
-{
- static char *cache;
- static unsigned long res;
- char *end;
- int i;
-
- if (cache && strcmp(cache, arg) == 0) {
- *id = res;
- return 0;
- }
-
- if (!rtnl_addrprot_tab_initialized)
- rtnl_addrprot_initialize();
-
- for (i = 0; i < 256; i++) {
- if (rtnl_addrprot_tab[i] &&
- strcmp(rtnl_addrprot_tab[i], arg) == 0) {
- cache = rtnl_addrprot_tab[i];
- res = i;
- *id = res;
- return 0;
- }
- }
-
- res = strtoul(arg, &end, 0);
- if (!end || end == arg || *end || res > 255)
- return -1;
- *id = res;
- return 0;
-}
-
-
static char *rtnl_rtscope_tab[256] = {
[RT_SCOPE_UNIVERSE] = "global",
[RT_SCOPE_NOWHERE] = "nowhere",
--
2.39.2
Powered by blists - more mailing lists