iwlwifi: mei: Replace zero-length array with flexible-array member
Subsystems (3)
PATCH 1/1 iwlwifi: mei: Replace zero-length array with flexible-array member
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].
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays
--- drivers/net/wireless/intel/iwlwifi/mei/sap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mei/sap.h +1 -1
@@ -298,7 +298,7 @@ struct iwl_sap_hdr {__le16 type;__le16 len;__le32 seq_num; -u8 payload[0 ]; +u8 payload[]; };/**
Signature · 1 line
2.27.0
Quoted 11 lines · Gustavo A. R. Silva
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].
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays
Signature · 1 line
Kees Cook
Quoted 7 lines · Kees Cook
Quoted 6 lines · Gustavo A. R. Silva
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].
Quoted 7 lines
Quoted 5 lines
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arraysReviewed-by Kees Cook <[email protected]>
Hi all,
Friendly ping: can someone take this, please?
...I can take this in my -next tree in the meantime.
Thanks
--
Gustavo
Quoted 15 lines · Gustavo A. R. Silva
Quoted 14 lines · Kees Cook
Quoted 12 lines · Gustavo A. R. Silva
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].
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2]
https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays
Quoted 7 lines
Quoted 1 line
Reviewed-by Kees Cook <[email protected]>Hi all,
Friendly ping: can someone take this, please?
...I can take this in my -next tree in the meantime.
I'll take this. Luca, ack?
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Coelho, Luciano
Acked-byQuoted 19 lines · Kalle Valo
Quoted 17 lines · Gustavo A. R. Silva
Quoted 15 lines · Kees Cook
Quoted 6 lines · Gustavo A. R. Silva
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].
Quoted 6 lines
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2]
https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arraysReviewed-by Kees Cook <[email protected]>
Quoted 7 lines
Quoted 5 lines
Hi all,
Friendly ping: can someone take this, please?
...I can take this in my -next tree in the meantime.
I'll take this. Luca, ack?
--
Cheers,
Luca.
Quoted 6 lines · Gustavo A. R. Silva
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].
Quoted 7 lines
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arraysSigned-off-by Gustavo A. R. Silva <[email protected]>Reviewed-by Kees Cook <[email protected]>Acked-by Luca Coelho <[email protected]>
Patch applied to wireless-next.git, thanks.
c5f675748cf0 iwlwifi: mei: Replace zero-length array with flexible-array member
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/20220216195030.GA904170@embeddedor/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches