cxl: Warn of flexible array in struct cxl_root_decoder
Dave Jiang
maintainerPATCH v2 1/1 cxl: Warn of flexible array in struct cxl_root_decoder
The 'cxl_switch_decoder' member in 'cxl_root_decoder' must be the last element due to 'cxl_switch_decoder' has a flexible array at the end of the struct. Any variables placed after will be corrupted. Add a warning comment to 'cxl_root_decoder'.
Signed-off-by Dave Jiang <[email protected]>
---
v2:
- Clarify subject (Alison)
- Fit comment under 80 chars. (Alison)
--- drivers/cxl/cxl.h | 1 + 1 file changed, 1 insertion(+)
drivers/cxl/cxl.h +1 -0
@@ -419,6 +419,7 @@ struct cxl_root_decoder {cxl_calc_hb_fn calc_hb;void *platform_data;struct mutex range_lock; +/* This must be the last member of the struct. It contains a flexible array */ struct cxl_switch_decoder cxlsd; };
Dave Jiang
maintainerQuoted 6 lines · Dave Jiang
The '
cxl_switch_decoder' member in 'cxl_root_decoder' must be the last element due to 'cxl_switch_decoder' has a flexible array at the end of the struct. Any variables placed after will be corrupted. Add a warning comment to 'cxl_root_decoder'.Signed-off-by Dave Jiang <[email protected]>
Please disregard this version. Diff wasn't updated.
Quoted 23 lines
---
v2:
- Clarify subject (Alison)
- Fit comment under 80 chars. (Alison)--- drivers/cxl/cxl.h | 1 + 1 file changed, 1 insertion(+)drivers/cxl/cxl.h +1
-0@@ -419,6 +419,7 @@ struct cxl_root_decoder {cxl_calc_hb_fn calc_hb;void *platform_data;struct mutex range_lock; +/* This must be the last member of the struct. It contains a flexible array */ struct cxl_switch_decoder cxlsd; };