All of lore.kernel.org
 help / color / mirror / Atom feed
* [tiwai-sound:for-next 9/10] sound/core/ump.c:694:6: warning: variable 'type' is uninitialized when used here
@ 2024-05-29 16:39 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-05-29 16:39 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: llvm, oe-kbuild-all, alsa-devel

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
head:   e472ffe6ae48ba80461ff1a7bb40f73665a856f0
commit: 42db3930d4d7384d4e241c928e8cb2a0cdc5589c [9/10] ALSA: ump: Don't accept an invalid UMP protocol number
config: i386-randconfig-011-20240529 (https://download.01.org/0day-ci/archive/20240530/202405300035.Fz3pTUG4-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240530/202405300035.Fz3pTUG4-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/202405300035.Fz3pTUG4-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> sound/core/ump.c:694:6: warning: variable 'type' is uninitialized when used here [-Wuninitialized]
     694 |         if (type != SNDRV_UMP_EP_INFO_PROTO_MIDI1 &&
         |             ^~~~
   sound/core/ump.c:688:19: note: initialize the variable 'type' to silence this warning
     688 |         unsigned int type;
         |                          ^
         |                           = 0
   1 warning generated.


vim +/type +694 sound/core/ump.c

   678	
   679	/**
   680	 * snd_ump_switch_protocol - switch MIDI protocol
   681	 * @ump: UMP endpoint
   682	 * @protocol: protocol to switch to
   683	 *
   684	 * Returns 1 if the protocol is actually switched, 0 if unchanged
   685	 */
   686	int snd_ump_switch_protocol(struct snd_ump_endpoint *ump, unsigned int protocol)
   687	{
   688		unsigned int type;
   689	
   690		protocol &= ump->info.protocol_caps;
   691		if (protocol == ump->info.protocol)
   692			return 0;
   693	
 > 694		if (type != SNDRV_UMP_EP_INFO_PROTO_MIDI1 &&
   695		    type != SNDRV_UMP_EP_INFO_PROTO_MIDI2)
   696			return 0;
   697	
   698		ump->info.protocol = protocol;
   699		ump_dbg(ump, "New protocol = %x (caps = %x)\n",
   700			protocol, ump->info.protocol_caps);
   701		seq_notify_protocol(ump);
   702		return 1;
   703	}
   704	EXPORT_SYMBOL_GPL(snd_ump_switch_protocol);
   705	

-- 
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-05-29 16:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-29 16:39 [tiwai-sound:for-next 9/10] sound/core/ump.c:694:6: warning: variable 'type' is uninitialized when used here kernel test robot

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.