llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Geoffrey D. Bennett" <g@b4.vu>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [geoffreybennett-scarlett-gen2:vocaster 14/15] sound/usb/mixer_scarlett2.c:3680:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false
Date: Wed, 13 Mar 2024 20:16:08 +0800	[thread overview]
Message-ID: <202403132042.rQDVoEIP-lkp@intel.com> (raw)

tree:   https://github.com/geoffreybennett/scarlett-gen2.git vocaster
head:   b78687f7243142a4466f63c0aee9742b44ee395d
commit: 33d7f6dc965ab09522361ec99745a0685e4b8272 [14/15] ALSA: scarlett2: Add autogain target controls
config: arm-defconfig (https://download.01.org/0day-ci/archive/20240313/202403132042.rQDVoEIP-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240313/202403132042.rQDVoEIP-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/202403132042.rQDVoEIP-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> sound/usb/mixer_scarlett2.c:3680:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (private->autogain_updated) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~
   sound/usb/mixer_scarlett2.c:3690:9: note: uninitialized use occurs here
           return err;
                  ^~~
   sound/usb/mixer_scarlett2.c:3680:2: note: remove the 'if' if its condition is always true
           if (private->autogain_updated) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/usb/mixer_scarlett2.c:3671:9: note: initialize the variable 'err' to silence this warning
           int err;
                  ^
                   = 0
   1 warning generated.


vim +3680 sound/usb/mixer_scarlett2.c

  3664	
  3665	static int scarlett2_ag_target_ctl_get(
  3666		struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
  3667	{
  3668		struct usb_mixer_elem_info *elem = kctl->private_data;
  3669		struct usb_mixer_interface *mixer = elem->head.mixer;
  3670		struct scarlett2_data *private = mixer->private_data;
  3671		int err;
  3672	
  3673		mutex_lock(&private->data_mutex);
  3674	
  3675		if (private->hwdep_in_use) {
  3676			err = -EBUSY;
  3677			goto unlock;
  3678		}
  3679	
> 3680		if (private->autogain_updated) {
  3681			err = scarlett2_update_autogain(mixer);
  3682			if (err < 0)
  3683				goto unlock;
  3684		}
  3685	
  3686		ucontrol->value.integer.value[0] = private->ag_targets[elem->control];
  3687	
  3688	unlock:
  3689		mutex_unlock(&private->data_mutex);
  3690		return err;
  3691	}
  3692	

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

                 reply	other threads:[~2024-03-13 12:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202403132042.rQDVoEIP-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=g@b4.vu \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).