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

From: Breno Leitao
Date: Mon Jan 08 2024 - 10:18:05 EST


On Sat, Jan 06, 2024 at 09:13:53AM -0700, David Ahern wrote:
> On 1/5/24 10:39 AM, Breno Leitao wrote:

> > -#if RT6_DEBUG >= 3
> > -#define RT6_TRACE(x...) pr_debug(x)
> > -#else
> > -#define RT6_TRACE(x...) do { ; } while (0)
> > -#endif
> > +#define RT6_TRACE(x...) do { if (RT6_DEBUG > 3) pr_debug(x); } while (0)
> >
> > struct rt6_info;
> > struct fib6_info;
>
> I question the value of RT6_TRACE vs just using pr_debug; pr_debug has
> zero cost until enabled and can be enabled by file or line. Not
> requiring a kernel build is actual better.
>
> [cc'ed Wei who added the macro]

I also questioned it.

Anyway, if we don't hear any strong opinion in favor of RT6_TRACE(), I
will replace it by pr_debug() in a v2.