linux-stable-rt/drivers/infiniband/hw/ehca
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
..
Kconfig
Makefile
ehca_av.c
ehca_classes.h IB/ehca: Adjust 64-bit alignment of create QP response for userspace 2007-10-09 19:59:14 -07:00
ehca_classes_pSeries.h
ehca_cq.c IB/ehca: Print return codes as signed decimal integers 2007-10-09 19:59:10 -07:00
ehca_eq.c
ehca_hca.c IB/ehca: Fix clipping of device limits to INT_MAX 2007-10-09 19:59:18 -07:00
ehca_irq.c IB/ehca: Misc cpuinit section annotations and #ifdef cleanups 2007-10-09 19:59:14 -07:00
ehca_irq.h
ehca_iverbs.h
ehca_main.c IB/ehca: Bump version number and change its format 2007-10-09 19:59:11 -07:00
ehca_mcast.c IB/ehca: Print return codes as signed decimal integers 2007-10-09 19:59:10 -07:00
ehca_mrmw.c IB/ehca: Only use MR large pages for hugetlb regions 2007-10-09 19:59:13 -07:00
ehca_mrmw.h
ehca_pd.c
ehca_qes.h
ehca_qp.c IB/ehca: Return srq_attr->max_sge in ehca_query_srq() 2007-10-09 19:59:15 -07:00
ehca_reqs.c IB/ehca: Print return codes as signed decimal integers 2007-10-09 19:59:10 -07:00
ehca_sqp.c IB/ehca: Print return codes as signed decimal integers 2007-10-09 19:59:10 -07:00
ehca_tools.h IB/ehca: Replace get_paca()->paca_index by the more portable raw_smp_processor_id() 2007-10-09 19:59:11 -07:00
ehca_uverbs.c IB/ehca: Print return codes as signed decimal integers 2007-10-09 19:59:10 -07:00
hcp_if.c IB/ehca: Serialize MR alloc and MR free hvCalls 2007-10-09 19:59:11 -07:00
hcp_if.h
hcp_phyp.c
hcp_phyp.h
hipz_fns.h
hipz_fns_core.h
hipz_hw.h
ipz_pt_fn.c
ipz_pt_fn.h