Skip to content

Commit eed5087

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: Squelch kbuild sparse complaint
New complaint from kbuild for 4.9.y: net/sunrpc/xprtrdma/verbs.c:489:19: sparse: incompatible types in comparison expression (different type sizes) verbs.c: 489 max_sge = min(ia->ri_device->attrs.max_sge, RPCRDMA_MAX_SEND_SGES); I can't reproduce this running sparse here. Likewise, "make W=1 net/sunrpc/xprtrdma/verbs.o" never indicated any issue. A little poking suggests that because the range of its values is small, gcc can make the actual width of RPCRDMA_MAX_SEND_SGES smaller than the width of an unsigned integer. Fixes: 16f906d ("xprtrdma: Reduce required number of send SGEs") Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: stable@kernel.org Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 38a3310 commit eed5087

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/sunrpc/xprtrdma/verbs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,8 @@ rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia,
503503
struct ib_cq *sendcq, *recvcq;
504504
int rc;
505505

506-
max_sge = min(ia->ri_device->attrs.max_sge, RPCRDMA_MAX_SEND_SGES);
506+
max_sge = min_t(unsigned int, ia->ri_device->attrs.max_sge,
507+
RPCRDMA_MAX_SEND_SGES);
507508
if (max_sge < RPCRDMA_MIN_SEND_SGES) {
508509
pr_warn("rpcrdma: HCA provides only %d send SGEs\n", max_sge);
509510
return -ENOMEM;

0 commit comments

Comments
 (0)