From: kernel test robot <lkp@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
alsa-devel@alsa-project.org
Subject: [tiwai-sound:for-next 9/10] sound/core/ump.c:694:6: warning: variable 'type' is uninitialized when used here
Date: Thu, 30 May 2024 00:39:01 +0800 [thread overview]
Message-ID: <202405300035.Fz3pTUG4-lkp@intel.com> (raw)
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
reply other threads:[~2024-05-29 16:40 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=202405300035.Fz3pTUG4-lkp@intel.com \
--to=lkp@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tiwai@suse.de \
/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