diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2023-08-15 14:39:53 -0600 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2023-08-16 09:28:33 +0300 |
commit | 18ddaeb03bdb65b84fece11a8cac5bf583ae1b91 (patch) | |
tree | 0f7df9362e0893a8b3aef5eb2d2d9d5b035c3e4f /drivers/infiniband/hw/irdma/verbs.c | |
parent | 295c95aa7e0310ad8a89e98f1632d066e8526bb2 (diff) |
RDMA/mlx4: Copy union directly
Copy union directly instead of using memcpy().
Note that in this case, a direct assignment is more readable and
consistent with the subsequent assignments.
This addresses the following -Wstringop-overflow warning seen in s390
with defconfig:
drivers/infiniband/hw/mlx4/main.c:296:33: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
296 | memcpy(&port_gid_table->gids[free].gid,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
297 | &attr->gid, sizeof(attr->gid));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This helps with the ongoing efforts to globally enable
-Wstringop-overflow.
Link: https://github.com/KSPP/linux/issues/308
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/ZNvimeRAPkJ24zRG@work
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband/hw/irdma/verbs.c')
0 files changed, 0 insertions, 0 deletions