lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202203241949.AXselCHw-lkp@intel.com>
Date:   Thu, 24 Mar 2022 19:50:24 +0800
From:   kernel test robot <lkp@...el.com>
To:     David Henningsson <coding@...ic.se>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org, Takashi Iwai <tiwai@...e.de>,
        Jaroslav Kysela <perex@...ex.cz>
Subject: sound/core/rawmidi.c:991:6: warning: variable 'dest_frames' set but
 not used

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@...el.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ