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

From: nasser

Date: Sun Jun 14 2026 - 04:43:14 EST


Hi Greg,

Thanks for the review and the feedback.

On Sun, Jun 14, 2026 at 06:15:00AM +0000, Greg Kroah-Hartman wrote:
> When you say "also" that implies it should be a separate patch.

Understood. I will split these changes into a two-patch series in v3.

> lkp didn't report the smatch warning :(

My mistake. I will fix the Reported-by and Closes tags in the next
version to correctly reflect the source of the warning.

> No list of what changed from previous versions?

I apologize for missing that. I will make sure to include a proper
changelog below the '---' line for v3.

I will send the v3 patch series shortly.

Thanks,
Abdelnasser


On Sun, Jun 14, 2026 at 9:17 AM Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> 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