# Re: \[PATCH v5 1/2\] sunrpc: simplify dfprintk macros and fix nfsd build error

- From: Geert Uytterhoeven \<geert@linux-m68k.org\>
- Date: 2026-03-02 13:15:30 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/03/3435455
- Thread: https://ratatoskr.run/netdev/2026/02/3433579/t.md

```text
CC Andy

On Mon, 2 Mar 2026 at 14:13, Sean Chang [ref] wrote:
> On Mon, Mar 2, 2026 at 5:41 PM Geert Uytterhoeven [ref] wrote:
> > This should have been fixed alteady, cfr.
> > "Re: [PATCH v3 0/3] sunrpc: Fix `make W=1` build issues"?
> > https://lore.kernel.org/177024270291.126397.9981743455921781902.b4-ty@oracle.com
> >
>
> Hi Geert,
> Thanks for the feedback. Regarding the patch you mentioned, I've
> actually addressed this in the v6 series sent yesterday [1].
>
> My v6 approach is cleaner for a few reasons:
> 1. Compiler Optimization: In v6, we don't need explicit
> IS_ENABLED(CONFIG_SUNRPC_DEBUG) checks in files like
> fs/nfsd/nfsfh.c. With -O2, the compiler already proves these branches
> are unreachable and optimizes them away automatically.
>
> 2. Eliminating Redundancy: In include/linux/sunrpc/debug.h, the patch
> you cited adds no_printk inside an else branch of ifdebug, which is
> redundant. Since no_printk already performs type checking via
> ##__VA_ARGS__, simply refactoring the macro is sufficient:
> -# define dfprintk(fac, fmt, ...)  do {} while (0)
> +# define dfprintk(fac, ...)       no_printk(__VA_ARGS__)
>
> 3. Reducing Stubs: This also avoids the need for extra stub functions
> when CONFIG_SUNRPC_DEBUG is disabled, as seen in fs/lockd/svclock.c.
>
> This v6 series has already been reviewed by Andrew Lunn. I would
> appreciate it if you could take a look at the updated logic there.
>
> [1] https://lore.kernel.org/all/20260301161709.1365975-1-seanwascoding@gmail.com/T/#u
>
> Best Regards,
> Sean
```
