linux/drivers/infiniband/hw
Gustavo A. R. Silva 6fe1a9b9b6 IB/hfi1: Use struct_size() helper
Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes, in particular in the
context in which this code is being used.

So, replace the following form:

sizeof(struct opa_port_status_rsp) + num_vls * sizeof(struct _vls_pctrs)

with:

struct_size(rsp, vls, num_vls)

and so on...

Also, notice that variable size is unnecessary, hence it is removed.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2019-05-30 15:40:50 -03:00
..
bnxt_re RDMA/bnxt_re: Use core helpers to get aligned DMA address 2019-05-06 13:08:11 -03:00
cxgb3 RDMA/cxgb3: Delete and properly mark unimplemented resize CQ function 2019-05-27 14:24:04 -03:00
cxgb4 iw_cxgb4: Fix qpid leak 2019-05-27 14:58:24 -03:00
efa RDMA/efa: Remove unused includes 2019-05-29 13:20:48 -03:00
hfi1 IB/hfi1: Use struct_size() helper 2019-05-30 15:40:50 -03:00
hns RDMA/hns: Replace magic numbers with #defines 2019-05-27 17:31:00 -03:00
i40iw RDMA/i40iw: Remove useless NULL checks 2019-05-21 15:50:53 -03:00
mlx4 IB/mlx4: Delete unused func arg 2019-05-21 15:27:25 -03:00
mlx5 RDMA/umem: Move page_shift from ib_umem to ib_odp_umem 2019-05-21 15:23:24 -03:00
mthca RDMA: Convert put_page() to put_user_page*() 2019-05-27 20:11:11 -03:00
nes RDMA/nes: Remove second wait queue initialization call 2019-05-21 15:50:53 -03:00
ocrdma RDMA: Directly cast the sockaddr union to sockaddr 2019-05-13 22:16:38 -03:00
qedr RDMA/qedr: Fix incorrect device rate. 2019-05-21 15:04:53 -03:00
qib IB/qib: Use struct_size() helper 2019-05-30 15:40:50 -03:00
usnic RDMA: Convert put_page() to put_user_page*() 2019-05-27 20:11:11 -03:00
vmw_pvrdma Merge branch 'rdma_mmap' into rdma.git for-next 2019-04-24 16:20:34 -03:00
Makefile RDMA/efa: Add driver to Kconfig/Makefile 2019-05-07 12:47:47 -03:00