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:
Li-Yu Yu 2022-05-09 19:02:53 +08:00 committed by Liam Girdwood
parent 2fd648efac
commit 842794af20
1 changed files with 2 additions and 2 deletions

View File

@ -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 {