From 3c14ebb0810e73ad899ae45e5fb2758153057e0e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 7 Dec 2011 01:29:49 +0400 Subject: lib: fix compile warnings from set-never-used The if_dump code had empty loop, that caused set-never-used warning. --- lib/if.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'lib/if.c') diff --git a/lib/if.c b/lib/if.c index 86f754b6..31c60e3f 100644 --- a/lib/if.c +++ b/lib/if.c @@ -426,9 +426,6 @@ if_flag_dump (unsigned long flag) static void if_dump (const struct interface *ifp) { - struct listnode *node; - struct connected *c; - zlog_info ("Interface %s index %d metric %d mtu %d " #ifdef HAVE_IPV6 "mtu6 %d " @@ -439,9 +436,6 @@ if_dump (const struct interface *ifp) ifp->mtu6, #endif /* HAVE_IPV6 */ if_flag_dump (ifp->flags)); - - for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, c)) - ; } /* Interface printing for all interface. */ -- cgit v1.2.1 From 23be94ea00fadace0007b6ffa6c9107124249e91 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Fri, 6 Jan 2012 16:07:39 +0000 Subject: lib/if: trivial, fix rarely used if debug function to print everything * if.c: (if_dump) loop that doesn't do anything, wants to be before the zlog of what it's meant to print out so all the connected addresses get printed out. Trival: just a debug function --- lib/if.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lib/if.c') diff --git a/lib/if.c b/lib/if.c index 31c60e3f..1e99ffbc 100644 --- a/lib/if.c +++ b/lib/if.c @@ -426,16 +426,20 @@ if_flag_dump (unsigned long flag) static void if_dump (const struct interface *ifp) { - zlog_info ("Interface %s index %d metric %d mtu %d " + struct listnode *node; + struct connected *c; + + for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, c)) + zlog_info ("Interface %s index %d metric %d mtu %d " #ifdef HAVE_IPV6 - "mtu6 %d " + "mtu6 %d " #endif /* HAVE_IPV6 */ - "%s", - ifp->name, ifp->ifindex, ifp->metric, ifp->mtu, + "%s", + ifp->name, ifp->ifindex, ifp->metric, ifp->mtu, #ifdef HAVE_IPV6 - ifp->mtu6, + ifp->mtu6, #endif /* HAVE_IPV6 */ - if_flag_dump (ifp->flags)); + if_flag_dump (ifp->flags)); } /* Interface printing for all interface. */ -- cgit v1.2.1