Linux NFS development
 help / color / mirror / Atom feed
* [PATCH RESEND linux-next] SUNRPC: Optimize list definition method
@ 2025-12-04  1:12 Chenguang Zhao
  2025-12-05 17:41 ` Chuck Lever
  0 siblings, 1 reply; 2+ messages in thread
From: Chenguang Zhao @ 2025-12-04  1:12 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker, Chuck Lever, Jeff Layton,
	NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman
  Cc: Chenguang Zhao, linux-nfs, netdev, linux-kernel

Integrate list definition and initialization into LIST_HEAD macro

Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
---
 net/sunrpc/backchannel_rqst.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index caa94cf57123..949022c5574c 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -131,7 +131,7 @@ EXPORT_SYMBOL_GPL(xprt_setup_backchannel);
 int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs)
 {
 	struct rpc_rqst *req;
-	struct list_head tmp_list;
+	LIST_HEAD(tmp_list);
 	int i;
 
 	dprintk("RPC:       setup backchannel transport\n");
@@ -147,7 +147,6 @@ int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs)
 	 * lock is held on the rpc_xprt struct.  It also makes cleanup
 	 * easier in case of memory allocation errors.
 	 */
-	INIT_LIST_HEAD(&tmp_list);
 	for (i = 0; i < min_reqs; i++) {
 		/* Pre-allocate one backchannel rpc_rqst */
 		req = xprt_alloc_bc_req(xprt);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND linux-next] SUNRPC: Optimize list definition method
  2025-12-04  1:12 [PATCH RESEND linux-next] SUNRPC: Optimize list definition method Chenguang Zhao
@ 2025-12-05 17:41 ` Chuck Lever
  0 siblings, 0 replies; 2+ messages in thread
From: Chuck Lever @ 2025-12-05 17:41 UTC (permalink / raw)
  To: Chenguang Zhao, Trond Myklebust, Anna Schumaker, Chuck Lever,
	Jeff Layton, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman
  Cc: linux-nfs, netdev, linux-kernel


On Wed, Dec 3, 2025, at 8:12 PM, Chenguang Zhao wrote:
> Integrate list definition and initialization into LIST_HEAD macro
>
> Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
> ---
>  net/sunrpc/backchannel_rqst.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
> index caa94cf57123..949022c5574c 100644
> --- a/net/sunrpc/backchannel_rqst.c
> +++ b/net/sunrpc/backchannel_rqst.c
> @@ -131,7 +131,7 @@ EXPORT_SYMBOL_GPL(xprt_setup_backchannel);
>  int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs)
>  {
>  	struct rpc_rqst *req;
> -	struct list_head tmp_list;
> +	LIST_HEAD(tmp_list);
>  	int i;
> 
>  	dprintk("RPC:       setup backchannel transport\n");
> @@ -147,7 +147,6 @@ int xprt_setup_bc(struct rpc_xprt *xprt, unsigned 
> int min_reqs)
>  	 * lock is held on the rpc_xprt struct.  It also makes cleanup
>  	 * easier in case of memory allocation errors.
>  	 */
> -	INIT_LIST_HEAD(&tmp_list);
>  	for (i = 0; i < min_reqs; i++) {
>  		/* Pre-allocate one backchannel rpc_rqst */
>  		req = xprt_alloc_bc_req(xprt);
> -- 
> 2.25.1

The commit message:

> SUNRPC: Optimize list definition method
> 
> Integrate list definition and initialization into LIST_HEAD macro

Only describes what the change does, not why it's needed. The body
just restates the diff in English.

A commit message should justify the change. For this patch, there's
no justification. Moreover the word "Optimize" in the subject is
misleading - it implies a benefit that doesn't exist.

If this change were genuinely needed, the commit message should
explain something like:

- "...to match the pattern used elsewhere in this file" (if applicable)
- "...as a prerequisite for X"
- "...to fix Y"

For example, is this patch part of a kernel-wide audit driven by a
code safety concern?


-- 
Chuck Lever

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-05 17:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-04  1:12 [PATCH RESEND linux-next] SUNRPC: Optimize list definition method Chenguang Zhao
2025-12-05 17:41 ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox