mirror of https://github.com/thesofproject/sof.git
mux: Annotate packed for structs that require a predictable layout
struct sof_mux_config and struct mux_stream_data are used to load binary data from userspace. Add packed attribute to ensure it has a stable and platform-independent layout. Signed-off-by: Li-Yu Yu <aaronyu@google.com>
This commit is contained in:
parent
2fd648efac
commit
842794af20
|
@ -57,7 +57,7 @@ struct mux_stream_data {
|
|||
|
||||
uint8_t reserved1[8 - PLATFORM_MAX_CHANNELS]; // padding for extra channels
|
||||
uint8_t reserved2[3]; // padding to ensure proper alignment of following instances
|
||||
};
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
typedef void(*demux_func)(struct comp_dev *dev, struct audio_stream *sink,
|
||||
const struct audio_stream *source, uint32_t frames,
|
||||
|
@ -113,7 +113,7 @@ struct sof_mux_config {
|
|||
uint16_t reserved; // padding to ensure proper alignment
|
||||
|
||||
struct mux_stream_data streams[];
|
||||
};
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
struct comp_data {
|
||||
union {
|
||||
|
|
Loading…
Reference in New Issue