linux/drivers/infiniband/hw
Arnd Bergmann 65fc82cea8 infiniband: hns: avoid gcc-7.0.1 warning for uninitialized data
commit 5b0ff9a007 upstream.

hns_roce_v1_cq_set_ci() calls roce_set_bit() on an uninitialized field,
which will then change only a few of its bits, causing a warning with
the latest gcc:

infiniband/hw/hns/hns_roce_hw_v1.c: In function 'hns_roce_v1_cq_set_ci':
infiniband/hw/hns/hns_roce_hw_v1.c:1854:23: error: 'doorbell[1]' is used uninitialized in this function [-Werror=uninitialized]
  roce_set_bit(doorbell[1], ROCEE_DB_OTHERS_H_ROCEE_DB_OTH_HW_SYNS_S, 1);

The code is actually correct since we always set all bits of the
port_vlan field, but gcc correctly points out that the first
access does contain uninitialized data.

This initializes the field to zero first before setting the
individual bits.

Fixes: 9a4435375c ("IB/hns: Add driver files for hns RoCE driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-07-05 14:40:30 +02:00
..
cxgb3 IB/cxgb3: Move user vendor structures 2016-10-07 16:54:35 -04:00
cxgb4 iw_cxgb4: set correct FetchBurstMax for QPs 2017-02-09 08:08:31 +01:00
hfi1 RDMA/qib,hfi1: Fix MR reference count leak on write with immediate 2017-06-07 12:07:49 +02:00
hns infiniband: hns: avoid gcc-7.0.1 warning for uninitialized data 2017-07-05 14:40:30 +02:00
i40iw i40iw: Use correct src address in memcpy to rdma stats counters 2017-01-09 08:32:24 +01:00
mlx4 IB/mlx4: Reduce SRIOV multicast cleanup warning message to debug level 2017-05-20 14:28:38 +02:00
mlx5 IB/mlx5: Fix kernel to user leak prevention logic 2017-06-24 07:11:15 +02:00
mthca mm: replace get_user_pages() write/force parameters with gup_flags 2016-10-19 08:11:43 -07:00
nes IB/nes: Move user vendor structures 2016-10-07 16:54:37 -04:00
ocrdma Merge of primary rdma-core code for 4.9 2016-10-09 17:04:33 -07:00
qedr RDMA/qedr: Return max inline data in QP query result 2017-06-17 06:41:58 +02:00
qib RDMA/qib,hfi1: Fix MR reference count leak on write with immediate 2017-06-07 12:07:49 +02:00
usnic mm: replace get_user_pages() write/force parameters with gup_flags 2016-10-19 08:11:43 -07:00
Makefile qedr: Add RoCE driver framework 2016-10-14 15:00:10 -04:00