From: kernel test robot <lkp@intel.com>
To: David Henningsson <coding@diwic.se>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org, Takashi Iwai <tiwai@suse.de>,
Jaroslav Kysela <perex@perex.cz>
Subject: sound/core/rawmidi.c:991:6: warning: variable 'dest_frames' set but not used
Date: Thu, 24 Mar 2022 19:50:24 +0800 [thread overview]
Message-ID: <202203241949.AXselCHw-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ed4643521e6af8ab8ed1e467630a85884d2696cf
commit: 08fdced60ca08e34e316a3ab945636fcdfcbc973 ALSA: rawmidi: Add framing mode
date: 10 months ago
config: mips-mtx1_defconfig (https://download.01.org/0day-ci/archive/20220324/202203241949.AXselCHw-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0f6d9501cf49ce02937099350d08f20c4af86f3d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=08fdced60ca08e34e316a3ab945636fcdfcbc973
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 08fdced60ca08e34e316a3ab945636fcdfcbc973
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash sound/core/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> sound/core/rawmidi.c:991:6: warning: variable 'dest_frames' set but not used [-Wunused-but-set-variable]
int dest_frames = 0;
^
1 warning generated.
vim +/dest_frames +991 sound/core/rawmidi.c
984
985 static int receive_with_tstamp_framing(struct snd_rawmidi_substream *substream,
986 const unsigned char *buffer, int src_count, const struct timespec64 *tstamp)
987 {
988 struct snd_rawmidi_runtime *runtime = substream->runtime;
989 struct snd_rawmidi_framing_tstamp *dest_ptr;
990 struct snd_rawmidi_framing_tstamp frame = { .tv_sec = tstamp->tv_sec, .tv_nsec = tstamp->tv_nsec };
> 991 int dest_frames = 0;
992 int orig_count = src_count;
993 int frame_size = sizeof(struct snd_rawmidi_framing_tstamp);
994
995 BUILD_BUG_ON(frame_size != 0x20);
996 if (snd_BUG_ON((runtime->hw_ptr & 0x1f) != 0))
997 return -EINVAL;
998
999 while (src_count > 0) {
1000 if ((int)(runtime->buffer_size - runtime->avail) < frame_size) {
1001 runtime->xruns += src_count;
1002 break;
1003 }
1004 if (src_count >= SNDRV_RAWMIDI_FRAMING_DATA_LENGTH)
1005 frame.length = SNDRV_RAWMIDI_FRAMING_DATA_LENGTH;
1006 else {
1007 frame.length = src_count;
1008 memset(frame.data, 0, SNDRV_RAWMIDI_FRAMING_DATA_LENGTH);
1009 }
1010 memcpy(frame.data, buffer, frame.length);
1011 buffer += frame.length;
1012 src_count -= frame.length;
1013 dest_ptr = (struct snd_rawmidi_framing_tstamp *) (runtime->buffer + runtime->hw_ptr);
1014 *dest_ptr = frame;
1015 runtime->avail += frame_size;
1016 runtime->hw_ptr += frame_size;
1017 runtime->hw_ptr %= runtime->buffer_size;
1018 dest_frames++;
1019 }
1020 return orig_count - src_count;
1021 }
1022
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-03-24 11:51 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=202203241949.AXselCHw-lkp@intel.com \
--to=lkp@intel.com \
--cc=coding@diwic.se \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=perex@perex.cz \
--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;
as well as URLs for NNTP newsgroup(s).