diff options
author | Gustavo A. R. Silva <gustavo@embeddedor.com> | 2019-05-29 10:15:28 -0500 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-05-30 15:40:50 -0300 |
commit | 6fe1a9b9b6542d460099395492d029bb6c6c2f5e (patch) | |
tree | ce7e3d5f3cda4b4a285095adbeb453e37518c321 /drivers/infiniband/core/uverbs_uapi.c | |
parent | IB/qib: Use struct_size() helper (diff) | |
download | linux-dev-6fe1a9b9b6542d460099395492d029bb6c6c2f5e.tar.xz linux-dev-6fe1a9b9b6542d460099395492d029bb6c6c2f5e.zip |
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>
Diffstat (limited to 'drivers/infiniband/core/uverbs_uapi.c')
0 files changed, 0 insertions, 0 deletions