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: <202208271332.DDtsB2NI-lkp@intel.com>
Date:   Sat, 27 Aug 2022 13:40:07 +0800
From:   kernel test robot <lkp@...el.com>
To:     Hans Verkuil <hverkuil@...all.nl>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org
Subject: [hverkuil-media-tree:for-v6.1f 8/15]
 drivers/staging/media/deprecated/cpia2/cpia2_usb.c:80:13: warning: variable
 'frame_count' set but not used

Hi Hans,

First bad commit (maybe != root cause):

tree:   git://linuxtv.org/hverkuil/media_tree.git for-v6.1f
head:   0a83e0cc43ddcd926277777a0a13c299d05595d0
commit: 24357c7aeb361b58f92fbed0b204bff166d98361 [8/15] cpia2: deprecate this driver
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20220827/202208271332.DDtsB2NI-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project a2100daf12fb980a29fd1a9c85ccf8eaaaf79730)
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
        git remote add hverkuil-media-tree git://linuxtv.org/hverkuil/media_tree.git
        git fetch --no-tags hverkuil-media-tree for-v6.1f
        git checkout 24357c7aeb361b58f92fbed0b204bff166d98361
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/staging/media/deprecated/cpia2/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> drivers/staging/media/deprecated/cpia2/cpia2_usb.c:80:13: warning: variable 'frame_count' set but not used [-Wunused-but-set-variable]
           static int frame_count;
                      ^
   1 warning generated.


vim +/frame_count +80 drivers/staging/media/deprecated/cpia2/cpia2_usb.c

ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   71  
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   72  
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   73  /******************************************************************************
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   74   *
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   75   *  process_frame
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   76   *
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   77   *****************************************************************************/
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   78  static void process_frame(struct camera_data *cam)
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   79  {
ff699e6bd02eb1 drivers/media/video/cpia2/cpia2_usb.c Douglas Schilling Landgraf 2008-04-22  @80  	static int frame_count;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   81  
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   82  	unsigned char *inbuff = cam->workbuff->data;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   83  
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   84  	DBG("Processing frame #%d, current:%d\n",
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   85  	    cam->workbuff->num, cam->curbuff->num);
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   86  
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   87  	if(cam->workbuff->length > cam->workbuff->max_length)
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   88  		cam->workbuff->max_length = cam->workbuff->length;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   89  
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   90  	if ((inbuff[0] == 0xFF) && (inbuff[1] == 0xD8)) {
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   91  		frame_count++;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   92  	} else {
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   93  		cam->workbuff->status = FRAME_ERROR;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   94  		DBG("Start of frame not found\n");
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   95  		return;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   96  	}
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   97  
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   98  	/***
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27   99  	 * Now the output buffer should have a JPEG image in it.
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  100  	 ***/
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  101  	if(!cam->first_image_seen) {
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  102  		/* Always skip the first image after streaming
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  103  		 * starts. It is almost certainly corrupt. */
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  104  		cam->first_image_seen = 1;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  105  		cam->workbuff->status = FRAME_EMPTY;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  106  		return;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  107  	}
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  108  	if (cam->workbuff->length > 3) {
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  109  		if(cam->mmapped &&
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  110  		   cam->workbuff->length < cam->workbuff->max_length) {
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  111  			/* No junk in the buffers */
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  112  			memset(cam->workbuff->data+cam->workbuff->length,
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  113  			       0, cam->workbuff->max_length-
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  114  				  cam->workbuff->length);
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  115  		}
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  116  		cam->workbuff->max_length = cam->workbuff->length;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  117  		cam->workbuff->status = FRAME_READY;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  118  
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  119  		if(!cam->mmapped && cam->num_frames > 2) {
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  120  			/* During normal reading, the most recent
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  121  			 * frame will be read.  If the current frame
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  122  			 * hasn't started reading yet, it will never
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  123  			 * be read, so mark it empty.  If the buffer is
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  124  			 * mmapped, or we have few buffers, we need to
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  125  			 * wait for the user to free the buffer.
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  126  			 *
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  127  			 * NOTE: This is not entirely foolproof with 3
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  128  			 * buffers, but it would take an EXTREMELY
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  129  			 * overloaded system to cause problems (possible
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  130  			 * image data corruption).  Basically, it would
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  131  			 * need to take more time to execute cpia2_read
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  132  			 * than it would for the camera to send
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  133  			 * cam->num_frames-2 frames before problems
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  134  			 * could occur.
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  135  			 */
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  136  			cam->curbuff->status = FRAME_EMPTY;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  137  		}
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  138  		cam->curbuff = cam->workbuff;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  139  		cam->workbuff = cam->workbuff->next;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  140  		DBG("Changed buffers, work:%d, current:%d\n",
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  141  		    cam->workbuff->num, cam->curbuff->num);
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  142  		return;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  143  	} else {
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  144  		DBG("Not enough data for an image.\n");
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  145  	}
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  146  
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  147  	cam->workbuff->status = FRAME_ERROR;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  148  	return;
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  149  }
ab33d5071de7a3 drivers/media/video/cpia2/cpia2_usb.c Alan Cox                   2006-02-27  150  

:::::: The code at line 80 was first introduced by commit
:::::: ff699e6bd02eb1c6d02c7c2b576c2ee6caab201c V4L/DVB (7094):  static memory

:::::: TO: Douglas Schilling Landgraf <dougsland@...il.com>
:::::: CC: Mauro Carvalho Chehab <mchehab@...radead.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ