diff mbox series

scsi: ipr: Replace 1-element arrays with flexible arrays

Message ID 20240711180702.work.536-kees@kernel.org
State New
Headers show
Series scsi: ipr: Replace 1-element arrays with flexible arrays | expand

Commit Message

Kees Cook July 11, 2024, 6:07 p.m. UTC
Replace the deprecated[1] use of a 1-element arrays in
struct ipr_hostrcb_fabric_desc and struct ipr_hostrcb64_fabric_desc
with modern flexible arrays.

No binary differences are present after this conversion.

Link: https://github.com/KSPP/linux/issues/79 [1]
Signed-off-by: Kees Cook <kees@kernel.org>
---
Cc: Brian King <brking@us.ibm.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
---
 drivers/scsi/ipr.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Martin K. Petersen Aug. 3, 2024, 1:30 a.m. UTC | #1
Kees,

> Replace the deprecated[1] use of a 1-element arrays in struct
> ipr_hostrcb_fabric_desc and struct ipr_hostrcb64_fabric_desc with
> modern flexible arrays.

Applied to 6.12/scsi-staging, thanks!
Martin K. Petersen Aug. 5, 2024, 9:17 p.m. UTC | #2
On Thu, 11 Jul 2024 11:07:06 -0700, Kees Cook wrote:

> Replace the deprecated[1] use of a 1-element arrays in
> struct ipr_hostrcb_fabric_desc and struct ipr_hostrcb64_fabric_desc
> with modern flexible arrays.
> 
> No binary differences are present after this conversion.
> 
> 
> [...]

Applied to 6.12/scsi-queue, thanks!

[1/1] scsi: ipr: Replace 1-element arrays with flexible arrays
      https://git.kernel.org/mkp/scsi/c/c72e13cf820b
diff mbox series

Patch

diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index c77d6ca1a210..b2b643c6dbbe 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -1030,7 +1030,7 @@  struct ipr_hostrcb_fabric_desc {
 #define IPR_PATH_FAILED			0x03
 
 	__be16 num_entries;
-	struct ipr_hostrcb_config_element elem[1];
+	struct ipr_hostrcb_config_element elem[];
 }__attribute__((packed, aligned (4)));
 
 struct ipr_hostrcb64_fabric_desc {
@@ -1044,7 +1044,7 @@  struct ipr_hostrcb64_fabric_desc {
 	u8 res_path[8];
 	u8 reserved3[6];
 	__be16 num_entries;
-	struct ipr_hostrcb64_config_element elem[1];
+	struct ipr_hostrcb64_config_element elem[];
 }__attribute__((packed, aligned (8)));
 
 #define for_each_hrrq(hrrq, ioa_cfg) \