Re: [PATCH RESEND net-next 2/2] net/ipv6: resolve warning in ip6_fib.c

From: David Ahern
Date: Mon Jan 22 2024 - 14:41:56 EST


On 1/22/24 11:19 AM, Breno Leitao wrote:
> In some configurations, the 'iter' variable in function
> fib6_repair_tree() is unused, resulting the following warning when
> compiled with W=1.
>
> net/ipv6/ip6_fib.c:1781:6: warning: variable 'iter' set but not used [-Wunused-but-set-variable]
> 1781 | int iter = 0;
> | ^
>
> It is unclear what is the advantage of this RT6_TRACE() macro[1], since
> users can control pr_debug() in runtime, which is better than at
> compilation time. pr_debug() has no overhead when disabled.
>
> Remove the RT6_TRACE() in favor of simple pr_debug() helpers.
>
> [1] Link: https://lore.kernel.org/all/ZZwSEJv2HgI0cD4J@xxxxxxxxx/
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
> ---
> include/net/ip6_fib.h | 6 ------
> net/ipv6/ip6_fib.c | 15 +++++++++------
> net/ipv6/route.c | 8 ++++----
> 3 files changed, 13 insertions(+), 16 deletions(-)
>

Reviewed-by: David Ahern <dsahern@xxxxxxxxxx>