Skip to contentSkip to conversation

cxl: Add comment about 'cxl_root_decoder' and flex array

PATCH Applied Dave Jiang 3 participants 4 messages Jun 10, 2025 – Jun 11, 2025 CXL

lore
Share & tools
lore

Dave Jiang

author maintainer
#0 lore raw

PATCH 1/1 cxl: Add comment about 'cxl_root_decoder' and flex array

Add a warning comment for 'struct cxl_root_decoder' to not add members after 'cxlsd' since 'cxlsd' has flex array at the end.

---
 drivers/cxl/cxl.h | 1 +
 1 file changed, 1 insertion(+)
drivers/cxl/cxl.h +1 -0
index 9a17e8beca7a..68596e9216f3 100644
@@ -445,6 +445,7 @@ struct cxl_root_decoder {
 	int qos_class;
 	const struct cxl_rd_ops *ops;
 	struct cxl_switch_decoder cxlsd;
+	/* DO NOT ADD AFTER THIS POINT, cxlsd has flex array component */
 };
 
 /*

base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
prerequisite-patch-id: 77982cd1ed494cf0f747ccf74c6b8949be9837d6

Signature · 1 line
2.49.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dave Jiang

Add a warning comment for 'struct cxl_root_decoder' to not add members after 'cxlsd' since 'cxlsd' has flex array at the end.

Quoted 19 lines
---
 drivers/cxl/cxl.h | 1 +
 1 file changed, 1 insertion(+)
drivers/cxl/cxl.h +1 -0
index 9a17e8beca7a..68596e9216f3 100644
@@ -445,6 +445,7 @@ struct cxl_root_decoder {
 	int qos_class;
 	const struct cxl_rd_ops *ops;
 	struct cxl_switch_decoder cxlsd;
+	/* DO NOT ADD AFTER THIS POINT, cxlsd has flex array component */
 };
 
 /*

base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
prerequisite-patch-id: 77982cd1ed494cf0f747ccf74c6b8949be9837d6

Reviewed-by
#2 lore raw
Quoted 6 lines · On Wed, 11 Jun 2025 19:19:47 +0800 Li Ming <[email protected]> wrote:
Quoted 4 lines · Dave Jiang

Add a warning comment for 'struct cxl_root_decoder' to not add members after 'cxlsd' since 'cxlsd' has flex array at the end.

Mind you this is pretty common and I thought we now had instrumentation to catch if anyone broke this rule? Maybe that project isn't quite there yet.

Quoted 21 lines
Quoted 19 lines
---
 drivers/cxl/cxl.h | 1 +
 1 file changed, 1 insertion(+)
drivers/cxl/cxl.h +1 -0
index 9a17e8beca7a..68596e9216f3 100644
@@ -445,6 +445,7 @@ struct cxl_root_decoder {
 	int qos_class;
 	const struct cxl_rd_ops *ops;
 	struct cxl_switch_decoder cxlsd;
+	/* DO NOT ADD AFTER THIS POINT, cxlsd has flex array component */
 };
 
 /*

base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
prerequisite-patch-id: 77982cd1ed494cf0f747ccf74c6b8949be9837d6

author maintainer Applied
#3 lore raw
In reply to Dave Jiang
Quoted 4 lines · Dave Jiang

Add a warning comment for 'struct cxl_root_decoder' to not add members after 'cxlsd' since 'cxlsd' has flex array at the end.

Applied to cxl/next

Quoted 19 lines
---
 drivers/cxl/cxl.h | 1 +
 1 file changed, 1 insertion(+)
drivers/cxl/cxl.h +1 -0
index 9a17e8beca7a..68596e9216f3 100644
@@ -445,6 +445,7 @@ struct cxl_root_decoder {
 	int qos_class;
 	const struct cxl_rd_ops *ops;
 	struct cxl_switch_decoder cxlsd;
+	/* DO NOT ADD AFTER THIS POINT, cxlsd has flex array component */
 };
 
 /*

base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
prerequisite-patch-id: 77982cd1ed494cf0f747ccf74c6b8949be9837d6