Skip to contentSkip to conversation

sctp: Replace zero-length array with DECLARE_FLEX_ARRAY() helper

PATCH New Bo Liu 1 participant 1 message Jan 10, 2023

Subsystems (2)
lore
Share & tools
lore

Bo Liu

author
#0 lore raw

PATCH 1/1 sctp: Replace zero-length array with DECLARE_FLEX_ARRAY() helper

Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members instead. So, replace zero-length array declaration in struct fid with the new DECLARE_FLEX_ARRAY() helper macro.

This helper allows for a flexible-array member in a union.

---
 include/linux/sctp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sctp.h +1 -1
index 358dc08e0831..09fdb7206f08 100644
@@ -239,7 +239,7 @@ struct sctp_idatahdr {
 		__u32 ppid;
 		__be32 fsn;
 	};
-	__u8 payload[0];
+	DECLARE_FLEX_ARRAY(__u8, payload);
 };
 
 struct sctp_idata_chunk {
Signature · 1 line
2.27.0