scsi: mpt3sas: Use flexible arrays when obviously possible
authorJames Seo <james@equiv.tech>
Sun, 6 Aug 2023 17:05:53 +0000 (10:05 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 15 Nov 2023 13:52:01 +0000 (08:52 -0500)
commitaa4db51bbd51654e215905f384eecf22327bafa9
tree30c849f1764be77d2ca4566873414f3181ad8f61
parentb85ea95d086471afb4ad062012a4d73cd328fa86
scsi: mpt3sas: Use flexible arrays when obviously possible

These terminal 1-length variable arrays can be directly converted into C99
flexible array members without any binary changes.

In most cases, they belong to unused structs, or to structs used only by
unused code. The remaining few coincidentally have their sizes calculated
in roundabout ways that do not depend on the sizeof() their structs.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: James Seo <james@equiv.tech>
Link: https://lore.kernel.org/r/20230806170604.16143-2-james@equiv.tech
Tested-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
drivers/scsi/mpt3sas/mpi/mpi2_image.h
drivers/scsi/mpt3sas/mpi/mpi2_ioc.h