diff options
author | Roland Dreier <rolandd@cisco.com> | 2007-10-09 19:59:18 -0700 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-10-09 19:59:18 -0700 |
commit | 76dea3bc2644e99cce1d98d0bbd3124314e5b50a (patch) | |
tree | 14ffcb341294948c429274922cbe6a4bcedcf5bb /drivers/infiniband/hw/ipath/ipath_kernel.h | |
parent | ede6bc04f3a07a9c93f02c92cdc281d254398321 (diff) |
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>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_kernel.h')
0 files changed, 0 insertions, 0 deletions