Skip to content

Commit

Permalink
bgpd: Remove set but unused variables
Browse files Browse the repository at this point in the history
Found by clang 15.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
  • Loading branch information
donaldsharp committed Mar 28, 2023
1 parent 328b64f commit 2cc428b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 41 deletions.
5 changes: 1 addition & 4 deletions bgpd/rfapi/rfapi_import.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down
15 changes: 0 additions & 15 deletions bgpd/rfapi/rfapi_rib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {

Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;

Expand Down
19 changes: 2 additions & 17 deletions bgpd/rfapi/rfapi_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions bgpd/rfapi/vnc_import_bgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand Down

0 comments on commit 2cc428b

Please sign in to comment.