Commit ed73a505 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Leon Romanovsky

RDMA/erdma: Replace zero-length arrays with flexible-array members

Zero-length arrays are deprecated[1] and we are moving towards
adopting C99 flexible-array members instead. So, replace zero-length
arrays, in a couple of structures, with flex-array members.

This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
routines on memcpy() and help us make progress towards globally
enabling -fstrict-flex-arrays=3 [2].

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays [1]
Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [2]
Link: https://github.com/KSPP/linux/issues/78Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/Y7zCBqwC1LtabRJ9@workReviewed-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarCheng Xu <chengyou@linux.alibaba.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 8067fd8b
......@@ -397,7 +397,7 @@ struct erdma_write_sqe {
__le32 rsvd;
struct erdma_sge sgl[0];
struct erdma_sge sgl[];
};
struct erdma_send_sqe {
......@@ -408,7 +408,7 @@ struct erdma_send_sqe {
};
__le32 length;
struct erdma_sge sgl[0];
struct erdma_sge sgl[];
};
struct erdma_readreq_sqe {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment