cxl: Add comment about 'cxl_root_decoder' and flex array
Dave Jiang
maintainerPATCH 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
@@ -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
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.Signed-off-by Dave Jiang <[email protected]>
Quoted 19 lines
--- drivers/cxl/cxl.h | 1 + 1 file changed, 1 insertion(+)drivers/cxl/cxl.h +1
-0@@ -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
Jonathan Cameron
Reviewed-byQuoted 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.Signed-off-by Dave Jiang <[email protected]>Reviewed-by Li Ming <[email protected]>
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@@ -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
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.Signed-off-by Dave Jiang <[email protected]>
Applied to cxl/next
Quoted 19 lines
--- drivers/cxl/cxl.h | 1 + 1 file changed, 1 insertion(+)drivers/cxl/cxl.h +1
-0@@ -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