All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: abdelnasser hussein <abdelnasserhussein11@gmail.com>,
	Vaibhav Agarwal <vaibhav.sr@gmail.com>,
	Mark Greer <mgreer@animalcreek.com>,
	Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	abdelnasser hussein <abdelnasserhussein11@gmail.com>
Subject: Re: [PATCH] staging: greybus: audio: evaluate sscanf() return value directly
Date: Sun, 14 Jun 2026 03:41:54 +0800	[thread overview]
Message-ID: <202606140347.gGVWDnbi-lkp@intel.com> (raw)
In-Reply-To: <20260613110748.13497-1-abdelnasserhussein11@gmail.com>

Hi abdelnasser,

kernel test robot noticed the following build warnings:

[auto build test WARNING on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/abdelnasser-hussein/staging-greybus-audio-evaluate-sscanf-return-value-directly/20260613-191253
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20260613110748.13497-1-abdelnasserhussein11%40gmail.com
patch subject: [PATCH] staging: greybus: audio: evaluate sscanf() return value directly
config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20260614/202606140347.gGVWDnbi-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 305faf498a4e0b52b40742c927af63ab2082e1a9)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260614/202606140347.gGVWDnbi-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606140347.gGVWDnbi-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/staging/greybus/audio_codec.c:325:13: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     325 |         } else if (w->id == snd_soc_dapm_aif_out) {
         |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging/greybus/audio_codec.c:334:9: note: uninitialized use occurs here
     334 |         return ret;
         |                ^~~
   drivers/staging/greybus/audio_codec.c:325:9: note: remove the 'if' if its condition is always true
     325 |         } else if (w->id == snd_soc_dapm_aif_out) {
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging/greybus/audio_codec.c:302:17: note: initialize the variable 'ret' to silence this warning
     302 |         int dai_id, ret;
         |                        ^
         |                         = 0
   1 warning generated.


vim +325 drivers/staging/greybus/audio_codec.c

6dd67645f22cfe Vaibhav Agarwal     2016-03-29  297  
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  298  int gbaudio_module_update(struct gbaudio_codec_info *codec,
4ffca62a051c3e Vaibhav Agarwal     2016-08-04  299  			  struct snd_soc_dapm_widget *w,
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  300  			  struct gbaudio_module_info *module, int enable)
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  301  {
60e7327d54b270 Vaibhav Agarwal     2016-08-04  302  	int dai_id, ret;
60e7327d54b270 Vaibhav Agarwal     2016-08-04  303  	char intf_name[NAME_SIZE], dir[NAME_SIZE];
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  304  
60e7327d54b270 Vaibhav Agarwal     2016-08-04  305  	dev_dbg(module->dev, "%s:Module update %s sequence\n", w->name,
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  306  		enable ? "Enable" : "Disable");
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  307  
487dcbd6ba4654 Vaibhav Agarwal     2016-08-04  308  	if ((w->id != snd_soc_dapm_aif_in) && (w->id != snd_soc_dapm_aif_out)) {
60e7327d54b270 Vaibhav Agarwal     2016-08-04  309  		dev_dbg(codec->dev, "No action required for %s\n", w->name);
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  310  		return 0;
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  311  	}
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  312  
60e7327d54b270 Vaibhav Agarwal     2016-08-04  313  	/* parse dai_id from AIF widget's stream_name */
034351c29c6494 abdelnasser hussein 2026-06-13  314  	if (sscanf(w->sname, "%s %d %s", intf_name, &dai_id, dir) != 3) {
620d28440c10b8 Deepak R Varma      2020-10-22  315  		dev_err(codec->dev, "Error while parsing dai_id for %s\n", w->name);
60e7327d54b270 Vaibhav Agarwal     2016-08-04  316  		return -EINVAL;
60e7327d54b270 Vaibhav Agarwal     2016-08-04  317  	}
60e7327d54b270 Vaibhav Agarwal     2016-08-04  318  
aaef32a6cc552d Vaibhav Agarwal     2016-08-04  319  	mutex_lock(&codec->lock);
487dcbd6ba4654 Vaibhav Agarwal     2016-08-04  320  	if (w->id == snd_soc_dapm_aif_in) {
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  321  		if (enable)
60e7327d54b270 Vaibhav Agarwal     2016-08-04  322  			ret = gbaudio_module_enable_tx(codec, module, dai_id);
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  323  		else
60e7327d54b270 Vaibhav Agarwal     2016-08-04  324  			ret = gbaudio_module_disable_tx(module, dai_id);
487dcbd6ba4654 Vaibhav Agarwal     2016-08-04 @325  	} else if (w->id == snd_soc_dapm_aif_out) {
094c4302c11889 Vaibhav Agarwal     2016-03-29  326  		if (enable)
60e7327d54b270 Vaibhav Agarwal     2016-08-04  327  			ret = gbaudio_module_enable_rx(codec, module, dai_id);
094c4302c11889 Vaibhav Agarwal     2016-03-29  328  		else
60e7327d54b270 Vaibhav Agarwal     2016-08-04  329  			ret = gbaudio_module_disable_rx(module, dai_id);
094c4302c11889 Vaibhav Agarwal     2016-03-29  330  	}
487dcbd6ba4654 Vaibhav Agarwal     2016-08-04  331  
aaef32a6cc552d Vaibhav Agarwal     2016-08-04  332  	mutex_unlock(&codec->lock);
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  333  
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  334  	return ret;
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  335  }
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  336  EXPORT_SYMBOL(gbaudio_module_update);
6dd67645f22cfe Vaibhav Agarwal     2016-03-29  337  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

      reply	other threads:[~2026-06-13 19:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-13 11:07 [PATCH] staging: greybus: audio: evaluate sscanf() return value directly abdelnasser hussein
2026-06-13 19:41 ` kernel test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202606140347.gGVWDnbi-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=abdelnasserhussein11@gmail.com \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=llvm@lists.linux.dev \
    --cc=mgreer@animalcreek.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=vaibhav.sr@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.