Thread (10 messages) 10 messages, 2 authors, 2026-03-20

Re: [PATCH v3 3/3] nfs: refactor nfs_errorf macros and remove unused ones

From: Sean Chang <hidden>
Date: 2026-03-19 14:59:14
Also in: linux-nfs, lkml

On Thu, Mar 19, 2026 at 10:41 PM Andy Shevchenko
[off-list ref] wrote:
On Thu, Mar 19, 2026 at 10:18:46PM +0800, Sean Chang wrote:
quoted
refactor nfs_errorf() and nfs_ferrorf() to the standard do-while(0)
pattern for safer macro expansion and kernel style compliance.

additionally, remove nfs_warnf() and nfs_fwarnf() as git grep
confirms they have no callers in the current tree.
...
quoted
 #define nfs_invalf(fc, fmt, ...) ((fc)->log.log ?            \
      invalf(fc, fmt, ## __VA_ARGS__) :                       \
quoted
      invalf(fc, fmt, ## __VA_ARGS__) :                       \
      ({ dfprintk(fac, fmt "\n", ## __VA_ARGS__);  -EINVAL; }))
Why not all of them?
I initially only refactored nfs_errorf because it doesn't return a value.
For nfs_invalf, it will always return -EINVAL. Would you prefer me to
refactor it using the ({ ... }) statement expression pattern to keep the
return value, or is it better to leave it as is ?

#define nfs_invalf(fc, fmt, ...) ({            \
    if ((fc)->log.log)                \
        invalf(fc, fmt, ## __VA_ARGS__);    \
    else                        \
        dfprintk(fac, fmt "\n", ## __VA_ARGS__);\
    -EINVAL;                    \
})
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help