Skip to content

Commit afb2450

Browse files
Chenguang ZhaoAnna Schumaker
authored andcommitted
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>
1 parent 728bea2 commit afb2450

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

net/sunrpc/backchannel_rqst.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ EXPORT_SYMBOL_GPL(xprt_setup_backchannel);
147147
int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs)
148148
{
149149
struct rpc_rqst *req;
150-
struct list_head tmp_list;
150+
LIST_HEAD(tmp_list);
151151
int i;
152152

153153
dprintk("RPC: setup backchannel transport\n");
@@ -163,7 +163,6 @@ int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs)
163163
* lock is held on the rpc_xprt struct. It also makes cleanup
164164
* easier in case of memory allocation errors.
165165
*/
166-
INIT_LIST_HEAD(&tmp_list);
167166
for (i = 0; i < min_reqs; i++) {
168167
/* Pre-allocate one backchannel rpc_rqst */
169168
req = xprt_alloc_bc_req(xprt);

0 commit comments

Comments
 (0)