Skip to contentSkip to conversation

ASoC: SOF: ipc4-loader: Return ssize_t from sof_ipc4_fw_parse_ext_man()

PATCH In review Peter Ujfalusi 2 participants 2 messages Oct 25, 2022 – Oct 26, 2022

Subsystems (3)
lore
Share & tools
lore

Peter Ujfalusi

author maintainer
#0 lore raw

PATCH 1/1 ASoC: SOF: ipc4-loader: Return ssize_t from sof_ipc4_fw_parse_ext_man()

sof_ipc4_fw_parse_ext_man() can return negative error numbers which is not correct for the used size_t type.

Change the return value to ssize_t and use the same type where the function is called.

Fixes 73c091a2fe96 ("ASoC: SOF: ipc4-loader: Support for loading external libraries")
---
 sound/soc/sof/ipc4-loader.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/sof/ipc4-loader.c +4 -4
index af0018b38cf0..702196774c50 100644
@@ -17,8 +17,8 @@
 /* The module ID includes the id of the library it is part of at offset 12 */
 #define SOF_IPC4_MOD_LIB_ID_SHIFT	12
 
-static size_t sof_ipc4_fw_parse_ext_man(struct snd_sof_dev *sdev,
-					struct sof_ipc4_fw_library *fw_lib)
+static ssize_t sof_ipc4_fw_parse_ext_man(struct snd_sof_dev *sdev,
+					 struct sof_ipc4_fw_library *fw_lib)
 {
 	struct sof_ipc4_fw_data *ipc4_data = sdev->private;
 	const struct firmware *fw = fw_lib->sof_fw.fw;
@@ -141,7 +141,7 @@ static size_t sof_ipc4_fw_parse_basefw_ext_man(struct snd_sof_dev *sdev)
 {
 	struct sof_ipc4_fw_data *ipc4_data = sdev->private;
 	struct sof_ipc4_fw_library *fw_lib;
-	size_t payload_offset;
+	ssize_t payload_offset;
 	int ret;
 
 	fw_lib = devm_kzalloc(sdev->dev, sizeof(*fw_lib), GFP_KERNEL);
@@ -170,7 +170,7 @@ static int sof_ipc4_load_library_by_uuid(struct snd_sof_dev *sdev,
 	struct sof_ipc4_fw_data *ipc4_data = sdev->private;
 	struct sof_ipc4_fw_library *fw_lib;
 	const char *fw_filename;
-	size_t payload_offset;
+	ssize_t payload_offset;
 	int ret, i, err;
 
 	if (!sdev->pdata->fw_lib_prefix) {
Signature · 1 line
2.38.1
maintainer
#1 lore raw
Quoted 8 lines · Peter Ujfalusi

sof_ipc4_fw_parse_ext_man() can return negative error numbers which is not correct for the used size_t type.

Change the return value to ssize_t and use the same type where the function is called.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: SOF: ipc4-loader: Return ssize_t from sof_ipc4_fw_parse_ext_man()

      commit: 5cab0d6c2bd1272287068943471102dc6a0c4bcc

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark