From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Sean Chang <seanwascoding@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Chuck Lever <chuck.lever@oracle.com>,
David Laight <david.laight.linux@gmail.com>,
Anna Schumaker <anna@kernel.org>,
netdev@vger.kernel.org, linux-nfs@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sunrpc: simplify dprintk macros and cleanup redundant debug guards
Date: Mon, 2 Mar 2026 18:51:24 +0200 [thread overview]
Message-ID: <aaXADI1NWecG190C@ashevche-desk.local> (raw)
In-Reply-To: <20260302161818.63651-1-seanwascoding@gmail.com>
On Tue, Mar 03, 2026 at 12:18:18AM +0800, Sean Chang wrote:
In the Subject: dprintk --> dprintk()
> Following David Laight's suggestion, simplify the macro definitions by
> removing the unnecessary 'fmt' argument and using no_printk(__VA_ARGS__)
> directly.
> This ensures the compiler performs type checking
This is already the case with the current code.
> and "sees" the variables, silencing the warnings without emitting any code.
Also, isn't it the current state of affairs?
> Verification with .lst files under -O2 confirms that the compiler
> successfully performs "dead code elimination". Even when variables
> (like char buf[] in nfsfh.c) or static helper functions (like
> nlmdbg_cookie2a in svclock.c) are declared without #ifdef, they are
> completely optimized out (no stack allocation, no symbol references in
> the final executable) as they are only referenced within no_printk().
>
> This allows for significant cleanup:
> - Remove redundant #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) from
> fs/nfsd/nfsfh.c and net/sunrpc/xprtrdma/svc_rdma_transport.c
> - Remove the #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) guard around
> nlmdbg_cookie2a and stub function in fs/lockd/svclock.c
nlmdbg_cookie2a()
> - Consolidate the dprintk definition to be more idiomatic.
dprintk()
Isn't this list redundant in the commit message? We can see this from the code
without much brain used.
...
> struct ib_qp_init_attr qp_attr;
> struct ib_device *dev;
> int ret = 0;
> + struct sockaddr *sap;
Keep it in reversed xmas tree order.
...
Ideally it would be nice to have this patch squashed to the mine, but I think
since it's part of nfsd-next, the rebasing is not an option. Since I am not
the maintainer, just my 2c.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-03-02 16:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 16:18 [PATCH] sunrpc: simplify dprintk macros and cleanup redundant debug guards Sean Chang
2026-03-02 16:51 ` Andy Shevchenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aaXADI1NWecG190C@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andrew@lunn.ch \
--cc=anna@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=david.laight.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=seanwascoding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox