summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-02-28 18:19:52 +0000
committerDonald Sharp <sharpd@nvidia.com>2023-03-28 10:07:38 -0400
commit2cc428bee24bbff391c45818c810fbb9127d89e3 (patch)
treeec122cf723b18db44f02511b6e92e97bca40c375
parent328b64fcb51c5f4a3f4ff9effc824f34d2d24cad (diff)
bgpd: Remove set but unused variables
Found by clang 15. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
-rw-r--r--bgpd/rfapi/rfapi_import.c5
-rw-r--r--bgpd/rfapi/rfapi_rib.c15
-rw-r--r--bgpd/rfapi/rfapi_vty.c19
-rw-r--r--bgpd/rfapi/vnc_import_bgp.c5
4 files changed, 3 insertions, 41 deletions
diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c
index e6da79fafb..4b8e07a9c4 100644
--- a/bgpd/rfapi/rfapi_import.c
+++ b/bgpd/rfapi/rfapi_import.c
@@ -127,7 +127,6 @@ void rfapiCheckRouteCount(void)
struct agg_node *rn;
int holddown_count = 0;
- int local_count = 0;
int imported_count = 0;
int remote_count = 0;
@@ -146,9 +145,7 @@ void rfapiCheckRouteCount(void)
++holddown_count;
} else {
- if (RFAPI_LOCAL_BI(bpi)) {
- ++local_count;
- } else {
+ if (!RFAPI_LOCAL_BI(bpi)) {
if (RFAPI_DIRECT_IMPORT_BI(
bpi)) {
++imported_count;
diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c
index 4dc3139ed1..be9d30768c 100644
--- a/bgpd/rfapi/rfapi_rib.c
+++ b/bgpd/rfapi/rfapi_rib.c
@@ -116,7 +116,6 @@ void rfapiRibCheckCounts(
struct bgp *bgp = bgp_get_default();
uint32_t t_pfx_active = 0;
- uint32_t t_pfx_deleted = 0;
uint32_t t_ri_active = 0;
uint32_t t_ri_deleted = 0;
@@ -131,7 +130,6 @@ void rfapiRibCheckCounts(
afi_t afi;
uint32_t pfx_active = 0;
- uint32_t pfx_deleted = 0;
for (afi = AFI_IP; afi < AFI_MAX; ++afi) {
@@ -156,8 +154,6 @@ void rfapiRibCheckCounts(
if (dsl) {
ri_deleted = skiplist_count(dsl);
t_ri_deleted += ri_deleted;
- ++pfx_deleted;
- ++t_pfx_deleted;
}
}
for (rn = agg_route_top(rfd->rib_pending[afi]); rn;
@@ -2303,10 +2299,6 @@ void rfapiRibShowResponses(void *stream, struct prefix *pfx_match,
int printedheader = 0;
int routes_total = 0;
int nhs_total = 0;
- int prefixes_total = 0;
- int prefixes_displayed = 0;
- int nves_total = 0;
- int nves_with_routes = 0;
int nves_displayed = 0;
int routes_displayed = 0;
int nhs_displayed = 0;
@@ -2326,10 +2318,6 @@ void rfapiRibShowResponses(void *stream, struct prefix *pfx_match,
int printednve = 0;
afi_t afi;
- ++nves_total;
- if (rfd->rib_prefix_count)
- ++nves_with_routes;
-
for (afi = AFI_IP; afi < AFI_MAX; ++afi) {
struct agg_node *rn;
@@ -2355,14 +2343,11 @@ void rfapiRibShowResponses(void *stream, struct prefix *pfx_match,
routes_total++;
nhs_total += skiplist_count(sl);
- ++prefixes_total;
if (pfx_match && !prefix_match(pfx_match, p)
&& !prefix_match(p, pfx_match))
continue;
- ++prefixes_displayed;
-
if (!printedheader) {
++printedheader;
diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c
index 94c77d826e..2877c29c20 100644
--- a/bgpd/rfapi/rfapi_vty.c
+++ b/bgpd/rfapi/rfapi_vty.c
@@ -822,11 +822,6 @@ int rfapiShowVncQueries(void *stream, struct prefix *pfx_match)
const char *vty_newline;
int printedheader = 0;
-
- int nves_total = 0;
- int nves_with_queries = 0;
- int nves_displayed = 0;
-
int queries_total = 0;
int queries_displayed = 0;
@@ -850,15 +845,9 @@ int rfapiShowVncQueries(void *stream, struct prefix *pfx_match)
struct agg_node *rn;
int printedquerier = 0;
-
- ++nves_total;
-
- if (rfd->mon
- || (rfd->mon_eth && skiplist_count(rfd->mon_eth))) {
- ++nves_with_queries;
- } else {
+ if (!rfd->mon &&
+ !(rfd->mon_eth && skiplist_count(rfd->mon_eth)))
continue;
- }
/*
* IP Queries
@@ -904,8 +893,6 @@ int rfapiShowVncQueries(void *stream, struct prefix *pfx_match)
fp(out, "%-15s %-15s", buf_vn, buf_un);
printedquerier = 1;
-
- ++nves_displayed;
} else
fp(out, "%-15s %-15s", "", "");
buf_remain[0] = 0;
@@ -978,8 +965,6 @@ int rfapiShowVncQueries(void *stream, struct prefix *pfx_match)
fp(out, "%-15s %-15s", buf_vn, buf_un);
printedquerier = 1;
-
- ++nves_displayed;
} else
fp(out, "%-15s %-15s", "", "");
buf_remain[0] = 0;
diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c
index 19ac6f353d..3fcc0e6f5f 100644
--- a/bgpd/rfapi/vnc_import_bgp.c
+++ b/bgpd/rfapi/vnc_import_bgp.c
@@ -1986,8 +1986,6 @@ void vnc_import_bgp_exterior_add_route_interior(
if (RFAPI_HAS_MONITOR_EXTERIOR(rn_interior)) {
- int count = 0; /* debugging */
-
vnc_zlog_debug_verbose(
"%s: has exterior monitor; ext src: %p", __func__,
RFAPI_MONITOR_EXTERIOR(rn_interior)->source);
@@ -2011,9 +2009,6 @@ void vnc_import_bgp_exterior_add_route_interior(
struct attr new_attr;
uint32_t label = 0;
-
- ++count; /* debugging */
-
assert(bpi_exterior);
assert(pfx_exterior);