scsi: 3w-xxxx: Replace one-element array with flexible-array member
authorGustavo A. R. Silva <gustavoars@kernel.org>
Thu, 22 Sep 2022 19:08:44 +0000 (14:08 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 25 Sep 2022 17:06:00 +0000 (13:06 -0400)
commit0fb9125e2aff083f42787cd686188c944d1a11f7
tree825c9f9c2e44ebaba0e41e9e2cbdc7a725b8bcf3
parentd20796627fec15e79727b147707c632b0e2ca162
scsi: 3w-xxxx: Replace one-element array with flexible-array member

One-element arrays are deprecated, and we are replacing them with flexible
array members instead. So, replace one-element array with flexible-array
member in struct TAG_TW_New_Ioctl and refactor the rest of the code,
accordingly.

Notice that, in multiple places, the subtraction of 1 from
sizeof(TW_New_Ioctl) is removed, as this operation is now implicit
after the flex-array transformation.

Link: https://github.com/KSPP/linux/issues/79
Link: https://github.com/KSPP/linux/issues/206
Link: https://lore.kernel.org/r/YyyyvB30jnjRaw/F@work
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/3w-xxxx.c
drivers/scsi/3w-xxxx.h