llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [geoffreybennett-scarlett-gen2:vocaster 14/15] sound/usb/mixer_scarlett2.c:3680:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false
@ 2024-03-13 12:16 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-03-13 12:16 UTC (permalink / raw)
  To: Geoffrey D. Bennett; +Cc: llvm, oe-kbuild-all

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-13 12:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13 12:16 [geoffreybennett-scarlett-gen2:vocaster 14/15] sound/usb/mixer_scarlett2.c:3680:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false kernel test robot

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).