Skip to contentSkip to conversation

intel-ipu3: Align struct ipu3_uapi_awb_fr_config_s to 32 bytes

PATCH In review Sakari Ailus 2 participants 2 messages Dec 2, 2019

Subsystems (3)
lore
Share & tools
lore

Sakari Ailus

author maintainer
#0 lore raw

PATCH 1/1 intel-ipu3: Align struct ipu3_uapi_awb_fr_config_s to 32 bytes

A struct that needs to be aligned to 32 bytes has a size of 28. Increase the size to 32.

This makes elements of arrays of this struct aligned to 32 as well, and other structs where members are aligned to 32 mixing ipu3_uapi_awb_fr_config_s as well as other types.

---
 drivers/staging/media/ipu3/include/intel-ipu3.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/ipu3/include/intel-ipu3.h +1 -1
index 08eaa0bad0de..1c9c3ba4d518 100644
@@ -449,7 +449,7 @@ struct ipu3_uapi_awb_fr_config_s {
 	__u16 reserved1;
 	__u32 bayer_sign;
 	__u8 bayer_nf;
-	__u8 reserved2[3];
+	__u8 reserved2[7];
 } __attribute__((aligned(32))) __packed;
 
 /**
Signature · 1 line
2.20.1
#1 lore raw
Quoted 9 lines · Sakari Ailus

A struct that needs to be aligned to 32 bytes has a size of 28. Increase the size to 32.

This makes elements of arrays of this struct aligned to 32 as well, and other structs where members are aligned to 32 mixing ipu3_uapi_awb_fr_config_s as well as other types.

The tags should have included:

Fixes commit dca5ef2aa1e6 ("media: staging/intel-ipu3: remove the unnecessary compiler flags")
Quoted 20 lines
---
 drivers/staging/media/ipu3/include/intel-ipu3.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/ipu3/include/intel-ipu3.h +1 -1
index 08eaa0bad0de..1c9c3ba4d518 100644
@@ -449,7 +449,7 @@ struct ipu3_uapi_awb_fr_config_s {
 	__u16 reserved1;
 	__u32 bayer_sign;
 	__u8 bayer_nf;
-	__u8 reserved2[3];
+	__u8 reserved2[7];
 } __attribute__((aligned(32))) __packed;
 
 /**
Signature · 1 line
2.20.1
Signature · 1 line
Sakari Ailus