mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
4e2e619f3c
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use "flexible array members"[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refactor the code according to the use of a flexible-array member in struct _SGE_TRANSACTION32 instead of one-element array. Also, this helps with the ongoing efforts to enable -Warray-bounds by fixing the following warning: CC [M] drivers/message/fusion/mptlan.o drivers/message/fusion/mptlan.c: In function ‘mpt_lan_sdu_send’: drivers/message/fusion/mptlan.c:759:28: warning: array subscript 1 is above array bounds of ‘U32[1]’ {aka ‘unsigned int[1]’} [-Warray-bounds] 759 | pTrans->TransactionDetails[1] = cpu_to_le32((mac[2] << 24) | | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/109 Link: https://lore.kernel.org/r/20210324233344.GA99059@embeddedor Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> |
||
---|---|---|
.. | ||
mpi_cnfg.h | ||
mpi_fc.h | ||
mpi_history.txt | ||
mpi_init.h | ||
mpi_ioc.h | ||
mpi_lan.h | ||
mpi_log_fc.h | ||
mpi_log_sas.h | ||
mpi_raid.h | ||
mpi_sas.h | ||
mpi_targ.h | ||
mpi_tool.h | ||
mpi_type.h | ||
mpi.h |