]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
scsi: qla2xxx: Replace one-element array with DECLARE_FLEX_ARRAY() helper
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 6 Jun 2023 23:22:21 +0000 (17:22 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 8 Jun 2023 01:27:28 +0000 (21:27 -0400)
commit512a365368c7af689c19e5a45d50d26cfe8c47cb
tree6863022398f3922fcec826246679deca66b6e65b
parent8cd6d0a39452df6101e486471f0e85c1736e9aaa
scsi: qla2xxx: Replace one-element array with DECLARE_FLEX_ARRAY() helper

One-element arrays as fake flex arrays are deprecated and we are moving
towards adopting C99 flexible-array members, instead. So, replace
one-element array declaration in struct ct_sns_gpnft_rsp, which is
ultimately being used inside a union:

drivers/scsi/qla2xxx/qla_def.h:
3240 struct ct_sns_gpnft_pkt {
3241         union {
3242                 struct ct_sns_req req;
3243                 struct ct_sns_gpnft_rsp rsp;
3244         } p;
3245 };

Refactor the rest of the code, accordingly.

This issue was found with the help of Coccinelle.

Link: https://github.com/KSPP/linux/issues/245
Link: https://github.com/KSPP/linux/issues/193
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/ZH+/rZ1R1cBjIxjS@work
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_gs.c