summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChenguang Zhao <zhaochenguang@kylinos.cn>2025-12-08 11:53:48 +0300
committerAnna Schumaker <anna.schumaker@oracle.com>2026-02-09 22:24:19 +0300
commitafb24505ff6583eb5150b4a54086188494d25c28 (patch)
tree5caca7b6220e6802b2b051a71abfb36a1d1ceebc
parent728bea264883031c377fcc9c465b650dbfd1bbf5 (diff)
downloadlinux-afb24505ff6583eb5150b4a54086188494d25c28.tar.xz
SUNRPC: Change list definition method
The LIST_HEAD macro can both define a linked list and initialize it in one step. To simplify code, we replace the separate operations of linked list definition and manual initialization with the LIST_HEAD macro. Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn> Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
-rw-r--r--net/sunrpc/backchannel_rqst.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index 68b1fcdea8f0..6b9dee4119d5 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -147,7 +147,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");
@@ -163,7 +163,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);