summaryrefslogtreecommitdiff
path: root/drivers/scsi/3w-xxxx.h
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavoars@kernel.org>2022-09-22 14:08:44 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2022-09-25 13:06:00 -0400
commit0fb9125e2aff083f42787cd686188c944d1a11f7 (patch)
tree825c9f9c2e44ebaba0e41e9e2cbdc7a725b8bcf3 /drivers/scsi/3w-xxxx.h
parentd20796627fec15e79727b147707c632b0e2ca162 (diff)
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.h2
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 */