linux/drivers/infiniband/hw
Arnd Bergmann 14ab8896f5 IB/mlx5: avoid bogus -Wmaybe-uninitialized warning
We get a false-positive warning in linux-next for the mlx5 driver:

infiniband/hw/mlx5/mr.c: In function ‘mlx5_ib_reg_user_mr’:
infiniband/hw/mlx5/mr.c:1172:5: error: ‘order’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
infiniband/hw/mlx5/mr.c:1161:6: note: ‘order’ was declared here
infiniband/hw/mlx5/mr.c:1173:6: error: ‘ncont’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
infiniband/hw/mlx5/mr.c:1160:6: note: ‘ncont’ was declared here
infiniband/hw/mlx5/mr.c:1173:6: error: ‘page_shift’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
infiniband/hw/mlx5/mr.c:1158:6: note: ‘page_shift’ was declared here
infiniband/hw/mlx5/mr.c:1143:13: error: ‘npages’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
infiniband/hw/mlx5/mr.c:1159:6: note: ‘npages’ was declared here

I had a trivial workaround for gcc-5 or higher, but that didn't work
on gcc-4.9 unfortunately.

The only way I found to avoid the warnings for gcc-4.9, short of
initializing each of the arguments first was to change the calling
conventions to separate the error code from the umem pointer. This
avoids casting the error codes from one pointer to another incompatible
pointer, and lets gcc figure out when that the data is actually valid
whenever we return successfully.

Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-14 12:12:53 -05:00
..
cxgb3 IB/core: Let create_ah return extended response to user 2016-12-13 13:38:27 -05:00
cxgb4 IB/core: Let create_ah return extended response to user 2016-12-13 13:38:27 -05:00
hfi1 Merge of primary rdma-core code for 4.9 2016-10-09 17:04:33 -07:00
hns IB/core: Let create_ah return extended response to user 2016-12-13 13:38:27 -05:00
i40iw IB/core: Let create_ah return extended response to user 2016-12-13 13:38:27 -05:00
mlx4 IB/mlx4: Fix out-of-range array index in destroy qp flow 2016-12-13 13:39:46 -05:00
mlx5 IB/mlx5: avoid bogus -Wmaybe-uninitialized warning 2016-12-14 12:12:53 -05:00
mthca IB/core: Let create_ah return extended response to user 2016-12-13 13:38:27 -05:00
nes IB/core: Let create_ah return extended response to user 2016-12-13 13:38:27 -05:00
ocrdma IB/core: Let create_ah return extended response to user 2016-12-13 13:38:27 -05:00
qedr IB/core: Let create_ah return extended response to user 2016-12-13 13:38:27 -05:00
qib mm: replace get_user_pages() write/force parameters with gup_flags 2016-10-19 08:11:43 -07:00
usnic IB/core: Let create_ah return extended response to user 2016-12-13 13:38:27 -05:00
Makefile qedr: Add RoCE driver framework 2016-10-14 15:00:10 -04:00