[linux-next:master 3176/4736] drivers/staging/media/deprecated/cpia2/cpia2_usb.c:80:13: warning: variable 'frame_count' set but not used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hans,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e47eb90a0a9ae20b82635b9b99a8d0979b757ad8
commit: be8cebc46d9d38166a1b3fda22a018ae52b0928e [3176/4736] media: cpia2: deprecate this driver
config: riscv-randconfig-r026-20220901 (https://download.01.org/0day-ci/archive/20220902/202209020437.eXEOdmfe-lkp@xxxxxxxxx/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project c55b41d5199d2394dd6cdb8f52180d8b81d809d4)
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 riscv cross compiling tool for clang build
        # apt-get install binutils-riscv-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=be8cebc46d9d38166a1b3fda22a018ae52b0928e
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout be8cebc46d9d38166a1b3fda22a018ae52b0928e
        # 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=riscv 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@xxxxxxxxx>

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

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

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



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux