Skip to content

Commit 2265202

Browse files
LaurentiuM1234broonie
authored andcommitted
ASoC: SOF: ipc: replace "enum sof_comp_type" field with "uint32_t"
Normally, the type of enums is "unsigned int" or "int". GCC has the "-fshort-enums" option, which instructs the compiler to use the smallest data type that can hold all the values in the enum (i.e: char, short, int or their unsigned variants). According to the GCC documentation, "-fshort-enums" may be default on some targets. This seems to be the case for SOF when built for a certain 32-bit ARM platform. On Linux, this is not the case (tested with "aarch64-linux-gnu-gcc") which means enums such as "enum sof_comp_type" will end up having different sizes on Linux and SOF. Since "enum sof_comp_type" is used in IPC-related structures such as "struct sof_ipc_comp", this means the fields of the structures will end up being placed at different offsets. This, in turn, leads to SOF not being able to properly interpret data passed from Linux. With this in mind, replace "enum sof_comp_type" from "struct sof_ipc_comp" with "uint32_t". Signed-off-by: Laurentiu Mihalcea <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 6781b96 commit 2265202

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/sound/sof/topology.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ enum sof_comp_type {
5454
struct sof_ipc_comp {
5555
struct sof_ipc_cmd_hdr hdr;
5656
uint32_t id;
57-
enum sof_comp_type type;
57+
uint32_t type;
5858
uint32_t pipeline_id;
5959
uint32_t core;
6060

include/uapi/sound/sof/abi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/* SOF ABI version major, minor and patch numbers */
3030
#define SOF_ABI_MAJOR 3
3131
#define SOF_ABI_MINOR 23
32-
#define SOF_ABI_PATCH 0
32+
#define SOF_ABI_PATCH 1
3333

3434
/* SOF ABI version number. Format within 32bit word is MMmmmppp */
3535
#define SOF_ABI_MAJOR_SHIFT 24

0 commit comments

Comments
 (0)