Re: [PATCH v5 4/5] nfs: Refactor nfs_errorf macros and remove unused ones

From: Sean Chang

Date: Wed Mar 25 2026 - 12:30:29 EST


On Sun, Mar 22, 2026 at 12:38 AM Chuck Lever <chuck.lever@xxxxxxxxxx> wrote:
>
> On 3/21/26 10:15 AM, Sean Chang wrote:
> > 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. Furthermore,
> > these functions have remained unused since the introduction in
> > commit ce8866f0913f ("NFS: Attach supplementary error information
> > to fs_context.").
> >
> > Reported-by: kernel test robot <lkp@xxxxxxxxx>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202603110038.P6d14oxa-lkp@xxxxxxxxx/
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
> > Tested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
> > Signed-off-by: Sean Chang <seanwascoding@xxxxxxxxx>
> > ---
> > fs/nfs/internal.h | 28 +++++++++++++---------------
> > 1 file changed, 13 insertions(+), 15 deletions(-)
>
> I need an Acked-by: from the NFS client maintainers on this one.
>

Hi Trond, Anna,

Could you please take a look at this refactoring patch for fs/nfs/internal.h?

This patch addresses a Sparse warning reported by the kernel test robot
where a ternary operation in the macros resulted in inconsistent types
(void vs int).
I have refactored the macros to use the standard do-while(0) pattern.

Andy Shevchenko has already reviewed and tested this, and Chuck is
looking for an Acked-by from the NFS client side to proceed with merging.

I'd appreciate your feedback or an Acked-by if this looks good to you.

Best Regards,
Sean