linux/include/sound/sof
Laurentiu Mihalcea 22652022c7
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 <laurentiu.mihalcea@nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20240826182442.6191-1-laurentiumihalcea111@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-26 19:29:39 +01:00
..
ipc4 ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00
channel_map.h ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00
control.h ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00
dai-amd.h ASoC: SOF: amd: Add Soundwire DAI configuration support for AMD platforms 2024-01-30 16:06:39 +00:00
dai-imx.h ASoC: SOF: Add support for configuring PDM interface from topology 2023-11-13 00:43:06 +00:00
dai-intel.h ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00
dai-mediatek.h ASoC: SOF: topology: Add support for Mediatek AFE DAI 2021-11-18 13:57:37 +00:00
dai.h ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00
debug.h ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00
ext_manifest.h ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00
ext_manifest4.h ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00
header.h ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00
info.h ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00
pm.h ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00
stream.h ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00
topology.h ASoC: SOF: ipc: replace "enum sof_comp_type" field with "uint32_t" 2024-08-26 19:29:39 +01:00
trace.h ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00
xtensa.h ALSA/ASoC: include: clarify Copyright information 2024-05-09 20:26:34 +02:00