state: use packed attribute for on storage structs
These structs are used for on-storage data layouts. They should be not affected by different integer precisions and alignment optimizations of 32bit or 64bit machines. Using the architecture independent integer data types, like uint32_t, achieves the former, using the packed attribute the later. Signed-off-by: Stefan Lengfeld <s.lengfeld@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
28d5eb1bbc
commit
88b67f8ee4
|
@ -47,7 +47,7 @@ struct state_backend_storage_bucket_circular {
|
|||
struct device_d *dev;
|
||||
};
|
||||
|
||||
struct state_backend_storage_bucket_circular_meta {
|
||||
struct __attribute__((__packed__)) state_backend_storage_bucket_circular_meta {
|
||||
uint32_t magic;
|
||||
uint32_t written_length;
|
||||
};
|
||||
|
|
|
@ -32,7 +32,7 @@ struct state_backend_storage_bucket_direct {
|
|||
struct device_d *dev;
|
||||
};
|
||||
|
||||
struct state_backend_storage_bucket_direct_meta {
|
||||
struct __attribute__((__packed__)) state_backend_storage_bucket_direct_meta {
|
||||
uint32_t magic;
|
||||
uint32_t written_length;
|
||||
};
|
||||
|
|
|
@ -37,7 +37,7 @@ struct state_backend_format_raw {
|
|||
struct device_d *dev;
|
||||
};
|
||||
|
||||
struct backend_raw_header {
|
||||
struct __attribute__((__packed__)) backend_raw_header {
|
||||
uint32_t magic;
|
||||
uint16_t reserved;
|
||||
uint16_t data_len;
|
||||
|
|
Loading…
Reference in New Issue