Re: [PATCH v2] staging: greybus: audio: check sscanf() result directly

From: Greg Kroah-Hartman

Date: Sun Jun 14 2026 - 02:17:08 EST


On Sun, Jun 14, 2026 at 09:08:57AM +0300, abdelnasser hussein wrote:
> Smatch warns:
>
> drivers/staging/greybus/audio_codec.c:335 gbaudio_module_update()
> warn: sscanf doesn't return error codes
>
> sscanf() returns the number of successfully matched input items, not a
> negative error code. Compare the return value directly with the expected
> number of conversions instead of storing it in ret as an error code.
>
> Also remove the redundant else-if check for snd_soc_dapm_aif_out. The
> widget id is validated earlier in the function, so the remaining branch
> can only handle snd_soc_dapm_aif_out. This avoids a compiler warning
> about a potentially uninitialized variable.

When you say "also" that implies it should be a separate patch.

>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>

lkp didn't report the smatch warning :(

> Closes: https://lore.kernel.org/oe-kbuild-all/202606140347.gGVWDnbi-lkp@xxxxxxxxx/
>
> Signed-off-by: abdelnasser hussein <abdelnasserhussein11@xxxxxxxxx>
> ---
> drivers/staging/greybus/audio_codec.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)

No list of what changed from previous versions?

thanks,

greg k-h