scsi: aacraid: struct aac_ciss_phys_luns_resp: Replace 1-element array with flexible array
Subsystems (2)
PATCH 1/1 scsi: aacraid: struct aac_ciss_phys_luns_resp: Replace 1-element array with flexible array
Replace the deprecated[1] use of a 1-element array in struct aac_ciss_phys_luns_resp with a modern flexible array.
No binary differences are present after this conversion.
---
Cc: Adaptec OEM Raid Solutions <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: [email protected]
--- drivers/scsi/aacraid/aachba.c | 2 +- drivers/scsi/aacraid/aacraid.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/aacraid/aachba.c +1 -1
@@ -1833,7 +1833,7 @@ static int aac_get_safw_ciss_luns(struct aac_dev *dev)struct aac_ciss_phys_luns_resp *phys_luns; datasize =sizeof (struct aac_ciss_phys_luns_resp ) + - (AAC_MAX_TARGETS -1 ) *sizeof (struct _ciss_lun ); +AAC_MAX_TARGETS *sizeof (struct _ciss_lun ); phys_luns =kmalloc (datasize,GFP_KERNEL );if (phys_luns ==NULL ) goto out;
drivers/scsi/aacraid/aacraid.h +1 -1
@@ -322,7 +322,7 @@ struct aac_ciss_phys_luns_resp {u8 level3[2 ];u8 level2[2 ];u8 node_ident[16 ];/* phys. node identifier */ - } lun[1 ];/* List of phys. devices */ + } lun[]; /* List of phys. devices */ };/*
Signature · 1 line
2.34.1
Quoted 22 lines · Kees Cook
Replace the deprecated[1] use of a 1-element array in struct
aac_ciss_phys_luns_respwith a modern flexible array.No binary differences are present after this conversion.
Signed-off-by Kees Cook <[email protected]>---
Cc: Adaptec OEM Raid Solutions <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: [email protected]--- drivers/scsi/aacraid/aachba.c | 2 +- drivers/scsi/aacraid/aacraid.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/scsi/aacraid/aachba.c +0
-0
drivers/scsi/aacraid/aachba.c static int aac_get_safw_ciss_luns(struct aac_dev *dev) · line 1836
Quoted 5 lines
drivers/scsi/aacraid/aachba.c +1
-1@@ -1833,7 +1833,7 @@ static int aac_get_safw_ciss_luns(struct aac_dev *dev)struct aac_ciss_phys_luns_resp *phys_luns; datasize =sizeof (struct aac_ciss_phys_luns_resp ) + - (AAC_MAX_TARGETS -1 ) *sizeof (struct _ciss_lun ); +AAC_MAX_TARGETS *sizeof (struct _ciss_lun );
I think this is a good candidate for struct_size().
In any case:
Thanks
Signature · 1 line
Gustavo
Quoted 16 lines
drivers/scsi/aacraid/aachba.c +0
-0phys_luns =kmalloc (datasize,GFP_KERNEL );if (phys_luns ==NULL ) goto out;drivers/scsi/aacraid/aacraid.h +1
-1@@ -322,7 +322,7 @@ struct aac_ciss_phys_luns_resp {u8 level3[2 ];u8 level2[2 ];u8 node_ident[16 ];/* phys. node identifier */ - } lun[1 ];/* List of phys. devices */ + } lun[]; /* List of phys. devices */ };/*
Martin K. Petersen
AppliedKees,
Quoted 2 lines
Replace the deprecated[1] use of a 1-element array in struct
aac_ciss_phys_luns_respwith a modern flexible array.
Applied to 6.12/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 6 lines · Kees Cook
Replace the deprecated[1] use of a 1-element array in struct
aac_ciss_phys_luns_respwith a modern flexible array.No binary differences are present after this conversion.
Applied to 6.12/scsi-queue, thanks!
[1/1] scsi: aacraid: struct aac_ciss_phys_luns_resp: Replace 1-element array with flexible array
https://git.kernel.org/mkp/scsi/c/2e35b43bc9a8
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering