]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: mpi3mr: struct mpi3_sas_io_unit_page1: Replace 1-element array with flexible...
authorKees Cook <kees@kernel.org>
Thu, 11 Jul 2024 15:56:36 +0000 (08:56 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 3 Aug 2024 01:22:41 +0000 (21:22 -0400)
Replace the deprecated[1] use of a 1-element array in struct
mpi3_sas_io_unit_page1 with a modern flexible array.

No binary differences are present after this conversion.

Link: https://github.com/KSPP/linux/issues/79
Signed-off-by: Kees Cook <kees@kernel.org>
Link: https://lore.kernel.org/r/20240711155637.3757036-4-kees@kernel.org
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h

index 66cca35d8e52dcc6a29f4e7dd9cf2b5355baf7d6..4b7a8f6314a333e5cb877ba5b6effe73fd1efb8b 100644 (file)
@@ -1603,9 +1603,6 @@ struct mpi3_sas_io_unit1_phy_data {
        __le32             reserved08;
 };
 
-#ifndef MPI3_SAS_IO_UNIT1_PHY_MAX
-#define MPI3_SAS_IO_UNIT1_PHY_MAX           (1)
-#endif
 struct mpi3_sas_io_unit_page1 {
        struct mpi3_config_page_header         header;
        __le16                             control_flags;
@@ -1615,7 +1612,7 @@ struct mpi3_sas_io_unit_page1 {
        u8                                 num_phys;
        u8                                 sata_max_q_depth;
        __le16                             reserved12;
-       struct mpi3_sas_io_unit1_phy_data      phy_data[MPI3_SAS_IO_UNIT1_PHY_MAX];
+       struct mpi3_sas_io_unit1_phy_data      phy_data[];
 };
 
 #define MPI3_SASIOUNIT1_PAGEVERSION                                 (0x00)