linux/drivers/infiniband/sw/rdmavt
Gustavo A. R. Silva 34755f5961 IB/rdmavt: 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 rvt_sge) * init_attr->cap.max_send_sge + sizeof(struct rvt_swqe)

with:

struct_size(swq, sg_list, init_attr->cap.max_send_sge)

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
..
ah.c RDMA/rdmavt: Catch use-after-free access of AH structures 2019-05-06 12:06:54 -03:00
ah.h RDMA: Handle AH allocations by IB/core 2019-04-08 13:05:25 -03:00
cq.c IB: Pass only ib_udata in function prototypes 2019-04-01 15:00:47 -03:00
cq.h IB: Pass only ib_udata in function prototypes 2019-04-01 15:00:47 -03:00
Kconfig IB/{hfi1, qib, rdmavt}: Move copy SGE logic into rdmavt 2018-10-03 16:38:28 -06:00
mad.c RDMA: Mark if destroy address handle is in a sleepable context 2018-12-19 16:28:03 -07:00
mad.h IB/rdmavt: Clean up distinction between port number and index 2016-03-10 20:37:31 -05:00
Makefile This is a tree wide change and has been kept separate for that reason. 2017-02-25 13:45:43 -08:00
mcast.c infiniband: fix sw/rdmavt/* kernel-doc notation 2018-01-10 22:00:35 -07:00
mcast.h IB/rdmavt: Fix copyright date 2016-03-10 20:37:27 -05:00
mmap.c IB: Pass only ib_udata in function prototypes 2019-04-01 15:00:47 -03:00
mmap.h IB: Pass only ib_udata in function prototypes 2019-04-01 15:00:47 -03:00
mr.c Merge branch 'rdma_mmap' into rdma.git for-next 2019-04-24 16:20:34 -03:00
mr.h IB: Pass uverbs_attr_bundle down ib_x destroy path 2019-04-01 14:57:35 -03:00
pd.c IB: Pass only ib_udata in function prototypes 2019-04-01 15:00:47 -03:00
pd.h IB: Pass only ib_udata in function prototypes 2019-04-01 15:00:47 -03:00
qp.c IB/rdmavt: Use struct_size() helper 2019-05-30 15:40:50 -03:00
qp.h IB/rdmavt: Fix ab/ba include issues 2019-04-24 11:31:49 -03:00
rc.c IB/rdmavt: Fix ab/ba include issues 2019-04-24 11:31:49 -03:00
srq.c RDMA: Handle SRQ allocations by IB/core 2019-04-08 13:05:25 -03:00
srq.h RDMA: Handle SRQ allocations by IB/core 2019-04-08 13:05:25 -03:00
trace_cq.h IB/rdmavt: Add wc_flags and wc_immdata to cq entry trace 2019-01-18 13:48:19 -07:00
trace_mr.h IB/rdmavt: Compress adjacent SGEs in rvt_lkey_ok() 2017-06-27 16:56:33 -04:00
trace_qp.h IB/rdmavt: Fix ab/ba include issues 2019-04-24 11:31:49 -03:00
trace_rc.h IB/rdmavt: Fix ab/ba include issues 2019-04-24 11:31:49 -03:00
trace_rvt.h IB/rdmavt: Fix trace hierarchy 2016-12-11 15:25:13 -05:00
trace_tx.h IB/rdmavt: Fix ab/ba include issues 2019-04-24 11:31:49 -03:00
trace.c IB/rdmavt: Fix copyright date 2016-03-10 20:37:27 -05:00
trace.h IB/{rdmavt, hfi1, qib}: Remove get_card_name() downcall 2018-01-05 13:34:55 -05:00
vt.c RDMA: Handle SRQ allocations by IB/core 2019-04-08 13:05:25 -03:00
vt.h IB: remove duplicate header files 2018-03-13 16:46:03 -04:00