Thread (11 messages) 11 messages, 5 authors, 2026-03-02

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

From: Sean Chang <hidden>
Date: 2026-03-02 13:13:42
Also in: linux-nfs, lkml

On Mon, Mar 2, 2026 at 5:41 PM Geert Uytterhoeven [off-list 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 (local)
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 (local)

Best Regards,
Sean
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help