Re: [PATCH 2/2] ASoC: Intel: avs: Fix type warning in avs_probe_compr_set_params()

Cezary Rojewski
2026-04-07T13:16:28Z

On 2026-04-07 1:28 PM, Mark Brown wrote:
> On Tue, Apr 07, 2026 at 10:54:59AM +0200, Cezary Rojewski wrote:
>> Expected argument type is snd_pcm_format_t.
>> Found out by sparse.
>
>> - bps = snd_pcm_format_physical_width(params->codec.format);
>> + bps = snd_pcm_format_physical_width((__force snd_pcm_format_t)params->codec.format);
>
> There was an earlier patch for this one that didn't get reviewed (and
> every time I looked at it the __force looks super suspect):
>
> https://patch.msgid.link/20260325021752.238203-1-songxiebing@kylinos.cn

I don't mind either version. This is basically an incremental update
which I should have sent long ago. The warning keeps bothering us in
the scans.

Are you suggesting we should squelch the warning instead of forcing the
conversion here? The use of __force is present within
include/sound/pcm_params.h, params_format().