linux_dsm_epyc7002/drivers/infiniband/hw/mlx5
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
..
ah.c IB/mlx5: Use kernel driver to help userspace create ah 2016-12-13 13:38:49 -05:00
cq.c IB/mlx5: Add support for CQE compressing 2016-12-13 13:34:20 -05:00
doorbell.c IB/mlx5: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
gsi.c IB/mlx5: Fix iteration overrun in GSI qps 2016-08-02 14:32:51 -04:00
ib_virt.c IB/mlx5: Implement callbacks for manipulating VFs 2016-03-21 17:13:14 -04:00
Kconfig net/mlx5: Extend mlx5_core to support ConnectX-4 Ethernet functionality 2015-05-30 18:24:51 -07:00
mad.c IB/{core,hw}: Add constant for node_desc 2016-10-07 16:54:34 -04:00
main.c IB/mlx5: Properly adjust rate limit on QP state transitions 2016-12-13 13:39:51 -05:00
Makefile IB/mlx5: Implement callbacks for manipulating VFs 2016-03-21 17:13:14 -04:00
mem.c IB/mlx5: Limit mkey page size to 2GB 2016-11-16 20:04:48 -05:00
mlx5_ib.h IB/mlx5: Properly adjust rate limit on QP state transitions 2016-12-13 13:39:51 -05:00
mr.c IB/mlx5: avoid bogus -Wmaybe-uninitialized warning 2016-12-14 12:12:53 -05:00
odp.c IB/mlx5/odp: Remove deprecated create_singlethread_workqueue 2016-10-07 16:54:29 -04:00
qp.c IB/mlx5: Properly adjust rate limit on QP state transitions 2016-12-13 13:39:51 -05:00
srq.c IB/mlx5: Assign SRQ type earlier 2016-12-13 13:39:46 -05:00