Skip to content

Commit f296cc1

Browse files
keesmartinkpetersen
authored andcommitted
scsi: message: fusion: struct _CONFIG_PAGE_IOC_4: Replace 1-element array with flexible array
Replace the deprecated[1] use of a 1-element array in struct _CONFIG_PAGE_IOC_4 with a modern flexible array. Additionally add __counted_by annotation since SEP is only ever accessed after updating ACtiveSEP: lsi/mpi_cnfg.h: IOC_4_SEP SEP[] __counted_by(ActiveSEP); /* 08h */ mptsas.c: ii = IOCPage4Ptr->ActiveSEP++; mptsas.c: IOCPage4Ptr->SEP[ii].SEPTargetID = id; mptsas.c: IOCPage4Ptr->SEP[ii].SEPBus = channel; No binary differences are present after this conversion. Link: KSPP#79 [1] Signed-off-by: Kees Cook <kees@kernel.org> Link: https://lore.kernel.org/r/20240711172821.123936-6-kees@kernel.org Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 7063132 commit f296cc1

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

drivers/message/fusion/lsi/mpi_cnfg.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,21 +1077,13 @@ typedef struct _IOC_4_SEP
10771077
} IOC_4_SEP, MPI_POINTER PTR_IOC_4_SEP,
10781078
Ioc4Sep_t, MPI_POINTER pIoc4Sep_t;
10791079

1080-
/*
1081-
* Host code (drivers, BIOS, utilities, etc.) should leave this define set to
1082-
* one and check Header.PageLength at runtime.
1083-
*/
1084-
#ifndef MPI_IOC_PAGE_4_SEP_MAX
1085-
#define MPI_IOC_PAGE_4_SEP_MAX (1)
1086-
#endif
1087-
10881080
typedef struct _CONFIG_PAGE_IOC_4
10891081
{
10901082
CONFIG_PAGE_HEADER Header; /* 00h */
10911083
U8 ActiveSEP; /* 04h */
10921084
U8 MaxSEP; /* 05h */
10931085
U16 Reserved1; /* 06h */
1094-
IOC_4_SEP SEP[MPI_IOC_PAGE_4_SEP_MAX]; /* 08h */
1086+
IOC_4_SEP SEP[] __counted_by(ActiveSEP); /* 08h */
10951087
} CONFIG_PAGE_IOC_4, MPI_POINTER PTR_CONFIG_PAGE_IOC_4,
10961088
IOCPage4_t, MPI_POINTER pIOCPage4_t;
10971089

0 commit comments

Comments
 (0)