Skip to contentSkip to conversation

ASoC: pcm: fix __le32 cast warning in snd_pcm_set_sync_per_card

PATCH In review Ben Dooks 2 participants 2 messages Jun 17 – Jun 18 Sound

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 ASoC: pcm: fix __le32 cast warning in snd_pcm_set_sync_per_card

In snd_pcm_set_sync_per_card() the le32 value is written to an u32 instead of an __le32 pointer. Fix the following warning by fixing the type:

sound/soc/soc-pcm.c:2166:9: warning: incorrect type in argument 7 (different base types)
sound/soc/soc-pcm.c:2166:9: expected int
sound/soc/soc-pcm.c:2166:9: got restricted snd_pcm_format_t

---
 sound/core/pcm_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/pcm_lib.c +1 -1
index fe597f7d522d..4d665b4148d7 100644
@@ -545,7 +545,7 @@ void snd_pcm_set_sync_per_card(struct snd_pcm_substream *substream,
 			       struct snd_pcm_hw_params *params,
 			       const unsigned char *id, unsigned int len)
 {
-	*(__u32 *)params->sync = cpu_to_le32(substream->pcm->card->number);
+	*(__le32 *)params->sync = cpu_to_le32(substream->pcm->card->number);
 	len = min(12, len);
 	memcpy(params->sync + 4, id, len);
 	memset(params->sync + 4 + len, 0, 12 - len);
Signature · 1 line
2.37.2.352.g3c44437643
#1 lore raw
Quoted 10 lines · Ben Dooks

In snd_pcm_set_sync_per_card() the le32 value is written to an u32 instead of an __le32 pointer. Fix the following warning by fixing the type:

sound/soc/soc-pcm.c:2166:9: warning: incorrect type in argument 7 (different base types)
sound/soc/soc-pcm.c:2166:9: expected int
sound/soc/soc-pcm.c:2166:9: got restricted snd_pcm_format_t

Applied now (with the correction of the subject prefix -- it's ALSA core, not ASoC-specific).

thanks,

Takashi