From: Ben Dooks <ben.dooks@codethink.co.uk>
To: Liam Girdwood <lgirdwood@gmail.com>,
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Daniel Baluta <daniel.baluta@nxp.com>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
sound-open-firmware@alsa-project.org,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Ben Dooks <ben.dooks@codethink.co.uk>
Subject: [PATCH v5] ASoC: SOF: sof-audio: pcm_id is __le32
Date: Tue, 24 Mar 2026 13:34:03 +0000 [thread overview]
Message-ID: <20260324133403.107708-1-ben.dooks@codethink.co.uk> (raw)
The pcm_id value is __le32 so convert it before passing to the dev_dbg
function to be printed. Also fixup some other uses of __le32 data and
a couple of places where %u should have been used instead of %d
Picked up by sparse prototype for variadic and printf
function checking. Fixes a large number of sparse warnings, such as:
sound/soc/sof/pcm.c:84:25: warning: incorrect type in argument 4 (different base types)
sound/soc/sof/pcm.c:84:25: expected unsigned int
sound/soc/sof/pcm.c:84:25: got restricted __le32 [usertype] pcm_id
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
v2: fix missing __le32 conversions
v3: further __le32 fixes for other header values
v4: fix signed-ness of printf formatting
---
sound/soc/sof/compress.c | 2 +-
sound/soc/sof/pcm.c | 2 +-
sound/soc/sof/topology.c | 12 ++++++------
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/sound/soc/sof/compress.c b/sound/soc/sof/compress.c
index c6c19df29035..3dbc05bf3b79 100644
--- a/sound/soc/sof/compress.c
+++ b/sound/soc/sof/compress.c
@@ -247,7 +247,7 @@ static int sof_compr_set_params(struct snd_soc_component *component,
ret = snd_sof_set_stream_data_offset(sdev, &spcm->stream[cstream->direction],
ipc_params_reply.posn_offset);
if (ret < 0) {
- dev_err(component->dev, "Invalid stream data offset for Compr %d\n",
+ dev_err(component->dev, "Invalid stream data offset for Compr %u\n",
le32_to_cpu(spcm->pcm.pcm_id));
goto out;
}
diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c
index d3af30398305..b2071edeaea6 100644
--- a/sound/soc/sof/pcm.c
+++ b/sound/soc/sof/pcm.c
@@ -360,7 +360,7 @@ static int sof_pcm_prepare(struct snd_soc_component *component,
platform_params = &spcm->platform_params[substream->stream];
ret = sof_widget_list_setup(sdev, spcm, params, platform_params, dir);
if (ret < 0) {
- dev_err(sdev->dev, "failed widget list set up for pcm %d dir %d\n",
+ dev_err(sdev->dev, "failed widget list set up for pcm %d dir %u\n",
le32_to_cpu(spcm->pcm.pcm_id), dir);
spcm->stream[dir].list = NULL;
snd_soc_dapm_dai_free_widgets(&list);
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 63d637db7053..907f9b1e9d1b 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -775,7 +775,7 @@ static int sof_parse_token_sets(struct snd_soc_component *scomp,
array);
break;
default:
- dev_err(scomp->dev, "error: unknown token type %d\n",
+ dev_err(scomp->dev, "error: unknown token type %u\n",
le32_to_cpu(array->type));
return -EINVAL;
}
@@ -880,7 +880,7 @@ static int sof_control_load_volume(struct snd_soc_component *scomp,
ARRAY_SIZE(led_tokens), mc->priv.array,
le32_to_cpu(mc->priv.size));
if (ret != 0) {
- dev_err(scomp->dev, "error: parse led tokens failed %d\n",
+ dev_err(scomp->dev, "error: parse led tokens failed %u\n",
le32_to_cpu(mc->priv.size));
goto err;
}
@@ -970,7 +970,7 @@ static int sof_control_load(struct snd_soc_component *scomp, int index,
struct snd_sof_control *scontrol;
int ret;
- dev_dbg(scomp->dev, "tplg: load control type %d name : %s\n",
+ dev_dbg(scomp->dev, "tplg: load control type %u name : %s\n",
le32_to_cpu(hdr->type), hdr->name);
scontrol = kzalloc_obj(*scontrol);
@@ -1015,7 +1015,7 @@ static int sof_control_load(struct snd_soc_component *scomp, int index,
case SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE:
case SND_SOC_TPLG_DAPM_CTL_PIN:
default:
- dev_warn(scomp->dev, "control type not supported %d:%d:%d\n",
+ dev_warn(scomp->dev, "control type not supported %u:%u:%u\n",
le32_to_cpu(hdr->ops.get),
le32_to_cpu(hdr->ops.put),
le32_to_cpu(hdr->ops.info));
@@ -1525,7 +1525,7 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
break;
case snd_soc_dapm_pga:
if (!le32_to_cpu(tw->num_kcontrols)) {
- dev_err(scomp->dev, "invalid kcontrol count %d for volume\n",
+ dev_err(scomp->dev, "invalid kcontrol count %u for volume\n",
le32_to_cpu(tw->num_kcontrols));
ret = -EINVAL;
break;
@@ -1774,7 +1774,7 @@ static int sof_dai_load(struct snd_soc_component *scomp, int index,
ARRAY_SIZE(stream_tokens), private->array,
le32_to_cpu(private->size));
if (ret) {
- dev_err(scomp->dev, "error: parse stream tokens failed %d\n",
+ dev_err(scomp->dev, "error: parse stream tokens failed %u\n",
le32_to_cpu(private->size));
return ret;
}
--
2.37.2.352.g3c44437643
next reply other threads:[~2026-03-24 13:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 13:34 Ben Dooks [this message]
2026-03-24 13:53 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260324133403.107708-1-ben.dooks@codethink.co.uk \
--to=ben.dooks@codethink.co.uk \
--cc=broonie@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=ranjani.sridharan@linux.intel.com \
--cc=sound-open-firmware@alsa-project.org \
--cc=tiwai@suse.com \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®