diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2022-09-22 22:08:44 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-09-25 20:06:00 +0300 |
commit | 0fb9125e2aff083f42787cd686188c944d1a11f7 (patch) | |
tree | 825c9f9c2e44ebaba0e41e9e2cbdc7a725b8bcf3 /drivers/scsi/3w-xxxx.h | |
parent | d20796627fec15e79727b147707c632b0e2ca162 (diff) | |
download | linux-0fb9125e2aff083f42787cd686188c944d1a11f7.tar.xz |
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>
Diffstat (limited to 'drivers/scsi/3w-xxxx.h')
-rw-r--r-- | drivers/scsi/3w-xxxx.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/3w-xxxx.h b/drivers/scsi/3w-xxxx.h index e8f3f081b7d8..120a087bdf3c 100644 --- a/drivers/scsi/3w-xxxx.h +++ b/drivers/scsi/3w-xxxx.h @@ -348,7 +348,7 @@ typedef struct TAG_TW_New_Ioctl { unsigned int data_buffer_length; unsigned char padding [508]; TW_Command firmware_command; - char data_buffer[1]; + char data_buffer[]; } TW_New_Ioctl; /* GetParam descriptor */ |