summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorZiyang Xuan <william.xuanziyang@huawei.com>2022-06-07 15:32:01 +0800
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2022-10-03 11:26:36 -0400
commitd6abc719a213b8c409789799786e11d203adb3b0 (patch)
treed391a82a05a5510a003ee3330de7f8c704ee172b /net/sunrpc
parent724e2df95b08a7e6ca989a9f96b29dc92ece9cd9 (diff)
downloadlinux-d6abc719a213b8c409789799786e11d203adb3b0.tar.bz2
SUNRPC: use max_t() to simplify open code
Use max_t() to simplify open code which uses "if...else" to get maximum of two values. Generated by coccinelle script: scripts/coccinelle/misc/minmax.cocci Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprt.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index a50febadb37e..71dc26373444 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1822,10 +1822,7 @@ struct rpc_xprt *xprt_alloc(struct net *net, size_t size,
goto out_free;
list_add(&req->rq_list, &xprt->free);
}
- if (max_alloc > num_prealloc)
- xprt->max_reqs = max_alloc;
- else
- xprt->max_reqs = num_prealloc;
+ xprt->max_reqs = max_t(unsigned int, max_alloc, num_prealloc);
xprt->min_reqs = num_prealloc;
xprt->num_reqs = num_prealloc;