From: Ziyang Xuan Date: Tue, 7 Jun 2022 07:32:01 +0000 (+0800) Subject: SUNRPC: use max_t() to simplify open code X-Git-Tag: v6.1-rc5~187^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d6abc719a213b8c409789799786e11d203adb3b0;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Anna Schumaker --- diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index a50feba..71dc263 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;