android_kernel_xiaomi_sm8350/drivers/infiniband/hw
Roland Dreier 76dea3bc26 IB/ehca: Fix clipping of device limits to INT_MAX
Doing min_t(int, foo, INT_MAX) doesn't work correctly, because if foo
is bigger than INT_MAX, then when treated as a signed integer, it will
become negative and hence such an expression is just an elaborate NOP.

Fix such cases in ehca to do min_t(unsigned, foo, INT_MAX) instead.
This fixes negative reported values for max_cqe, max_pd and max_ah:

Before:

        max_cqe:                        -64
        max_pd:                         -1
        max_ah:                         -1

After:
        max_cqe:                        2147483647
        max_pd:                         2147483647
        max_ah:                         2147483647

Based on a bug report and fix from Anton Blanchard <anton@samba.org>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-10-09 19:59:18 -07:00
..
amso1100 RDMA/amso1100: Initialize the wait_queue_head_t in the c2_qp structure 2007-07-28 08:06:40 -07:00
cxgb3 RDMA/cxgb3: Make the iw_cxgb3 module parameters writable 2007-10-09 19:59:04 -07:00
ehca IB/ehca: Fix clipping of device limits to INT_MAX 2007-10-09 19:59:18 -07:00
ipath Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband 2007-07-30 16:36:33 -07:00
mlx4 IB/mlx4: Implement FMRs 2007-10-09 19:59:16 -07:00
mthca IB/mthca: Use mmiowb() to avoid firmware commands getting jumbled up 2007-10-09 19:59:17 -07:00