* [PATCH] ALSA: usb-audio: qcom: Fix incorrect type in enable_audio_stream
@ 2026-04-08 5:43 songxiebing
2026-04-08 8:20 ` Takashi Iwai
2026-04-08 8:33 ` [PATCH v2] " songxiebing
0 siblings, 2 replies; 4+ messages in thread
From: songxiebing @ 2026-04-08 5:43 UTC (permalink / raw)
To: tiwai, perex; +Cc: linux-sound, linux-kernel, songxiebing, kernel test robot
Fix sparse warning:
sound/usb/qcom/qc_audio_offload.c:943:27: sparse: incorrect type in argument 2
expected unsigned int val but got snd_pcm_format_t.
Explicitly cast pcm_format to unsigned int for snd_mask_leave().
Fixes: 326bbc348298 ("ALSA: usb-audio: qcom: Introduce QC USB SND offloading support")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604062109.Oxi8JjWW-lkp@intel.com/
Signed-off-by: songxiebing <songxiebing@kylinos.cn>
---
sound/usb/qcom/qc_audio_offload.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c
index f161eb29f911..423e4a9b62e2 100644
--- a/sound/usb/qcom/qc_audio_offload.c
+++ b/sound/usb/qcom/qc_audio_offload.c
@@ -947,7 +947,7 @@ static int enable_audio_stream(struct snd_usb_substream *subs,
_snd_pcm_hw_params_any(¶ms);
m = hw_param_mask(¶ms, SNDRV_PCM_HW_PARAM_FORMAT);
- snd_mask_leave(m, pcm_format);
+ snd_mask_leave(m, (unsigned int)pcm_format);
i = hw_param_interval(¶ms, SNDRV_PCM_HW_PARAM_CHANNELS);
snd_interval_setinteger(i);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ALSA: usb-audio: qcom: Fix incorrect type in enable_audio_stream
2026-04-08 5:43 [PATCH] ALSA: usb-audio: qcom: Fix incorrect type in enable_audio_stream songxiebing
@ 2026-04-08 8:20 ` Takashi Iwai
2026-04-08 8:33 ` [PATCH v2] " songxiebing
1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2026-04-08 8:20 UTC (permalink / raw)
To: songxiebing; +Cc: tiwai, perex, linux-sound, linux-kernel, kernel test robot
On Wed, 08 Apr 2026 07:43:04 +0200,
songxiebing wrote:
>
> Fix sparse warning:
> sound/usb/qcom/qc_audio_offload.c:943:27: sparse: incorrect type in argument 2
> expected unsigned int val but got snd_pcm_format_t.
>
> Explicitly cast pcm_format to unsigned int for snd_mask_leave().
>
> Fixes: 326bbc348298 ("ALSA: usb-audio: qcom: Introduce QC USB SND offloading support")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202604062109.Oxi8JjWW-lkp@intel.com/
> Signed-off-by: songxiebing <songxiebing@kylinos.cn>
> ---
> sound/usb/qcom/qc_audio_offload.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c
> index f161eb29f911..423e4a9b62e2 100644
> --- a/sound/usb/qcom/qc_audio_offload.c
> +++ b/sound/usb/qcom/qc_audio_offload.c
> @@ -947,7 +947,7 @@ static int enable_audio_stream(struct snd_usb_substream *subs,
> _snd_pcm_hw_params_any(¶ms);
>
> m = hw_param_mask(¶ms, SNDRV_PCM_HW_PARAM_FORMAT);
> - snd_mask_leave(m, pcm_format);
> + snd_mask_leave(m, (unsigned int)pcm_format);
I believe you need __force prefix for cast, as it's strong-typed.
thanks,
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] ALSA: usb-audio: qcom: Fix incorrect type in enable_audio_stream
2026-04-08 5:43 [PATCH] ALSA: usb-audio: qcom: Fix incorrect type in enable_audio_stream songxiebing
2026-04-08 8:20 ` Takashi Iwai
@ 2026-04-08 8:33 ` songxiebing
2026-04-08 8:52 ` Takashi Iwai
1 sibling, 1 reply; 4+ messages in thread
From: songxiebing @ 2026-04-08 8:33 UTC (permalink / raw)
To: tiwai, perex; +Cc: linux-sound, linux-kernel, songxiebing, kernel test robot
Fix sparse warning:
sound/usb/qcom/qc_audio_offload.c:943:27: sparse: incorrect type in argument 2
expected unsigned int val but got snd_pcm_format_t.
Explicitly cast pcm_format to unsigned int for snd_mask_leave().
Fixes: 326bbc348298 ("ALSA: usb-audio: qcom: Introduce QC USB SND offloading support")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604062109.Oxi8JjWW-lkp@intel.com/
Signed-off-by: songxiebing <songxiebing@kylinos.cn>
---
v2:
- Add __force prefix for cast
---
sound/usb/qcom/qc_audio_offload.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c
index f161eb29f911..9c0d370860f3 100644
--- a/sound/usb/qcom/qc_audio_offload.c
+++ b/sound/usb/qcom/qc_audio_offload.c
@@ -947,7 +947,7 @@ static int enable_audio_stream(struct snd_usb_substream *subs,
_snd_pcm_hw_params_any(¶ms);
m = hw_param_mask(¶ms, SNDRV_PCM_HW_PARAM_FORMAT);
- snd_mask_leave(m, pcm_format);
+ snd_mask_leave(m, (__force unsigned int)pcm_format);
i = hw_param_interval(¶ms, SNDRV_PCM_HW_PARAM_CHANNELS);
snd_interval_setinteger(i);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ALSA: usb-audio: qcom: Fix incorrect type in enable_audio_stream
2026-04-08 8:33 ` [PATCH v2] " songxiebing
@ 2026-04-08 8:52 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2026-04-08 8:52 UTC (permalink / raw)
To: songxiebing; +Cc: tiwai, perex, linux-sound, linux-kernel, kernel test robot
On Wed, 08 Apr 2026 10:33:11 +0200,
songxiebing wrote:
>
> Fix sparse warning:
> sound/usb/qcom/qc_audio_offload.c:943:27: sparse: incorrect type in argument 2
> expected unsigned int val but got snd_pcm_format_t.
>
> Explicitly cast pcm_format to unsigned int for snd_mask_leave().
>
> Fixes: 326bbc348298 ("ALSA: usb-audio: qcom: Introduce QC USB SND offloading support")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202604062109.Oxi8JjWW-lkp@intel.com/
> Signed-off-by: songxiebing <songxiebing@kylinos.cn>
> ---
> v2:
> - Add __force prefix for cast
Applied to for-next branch. Thanks.
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-04-08 8:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 5:43 [PATCH] ALSA: usb-audio: qcom: Fix incorrect type in enable_audio_stream songxiebing
2026-04-08 8:20 ` Takashi Iwai
2026-04-08 8:33 ` [PATCH v2] " songxiebing
2026-04-08 8:52 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox