Re: [PATCH v2] media: i2c: imx334: support lower bandwidth mode

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

 



Hi shravan,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on v6.0-rc3]
[also build test WARNING on linus/master next-20220831]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/shravan-kumar/media-i2c-imx334-support-lower-bandwidth-mode/20220830-140816
base:    b90cb1053190353cc30f0fef0ef1f378ccc063c5
config: openrisc-randconfig-m031-20220830 (https://download.01.org/0day-ci/archive/20220901/202209011420.aFw0x1Jm-lkp@xxxxxxxxx/config)
compiler: or1k-linux-gcc (GCC) 12.1.0

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

smatch warnings:
drivers/media/i2c/imx334.c:832 imx334_set_pad_format() warn: unsigned 'code' is never less than zero.

vim +/code +832 drivers/media/i2c/imx334.c

   811	
   812	/**
   813	 * imx334_set_pad_format() - Set subdevice pad format
   814	 * @sd: pointer to imx334 V4L2 sub-device structure
   815	 * @sd_state: V4L2 sub-device state
   816	 * @fmt: V4L2 sub-device format need to be set
   817	 *
   818	 * Return: 0 if successful, error code otherwise.
   819	 */
   820	static int imx334_set_pad_format(struct v4l2_subdev *sd,
   821					 struct v4l2_subdev_state *sd_state,
   822					 struct v4l2_subdev_format *fmt)
   823	{
   824		struct imx334 *imx334 = to_imx334(sd);
   825		const struct imx334_mode *mode;
   826		int ret = 0;
   827		u32 code;
   828	
   829		mutex_lock(&imx334->mutex);
   830	
   831		code = imx219_get_format_code(imx334, fmt);
 > 832		if (code < 0)
   833			return -EINVAL;
   834	
   835		imx334->cur_code = code;
   836	
   837		mode = v4l2_find_nearest_size(supported_modes,
   838					      ARRAY_SIZE(supported_modes),
   839					      width, height,
   840					      fmt->format.width, fmt->format.height);
   841	
   842		imx334_fill_pad_format(imx334, mode, fmt);
   843	
   844		if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
   845			struct v4l2_mbus_framefmt *framefmt;
   846	
   847			framefmt = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
   848			*framefmt = fmt->format;
   849		} else if (imx334->cur_mode != mode) {
   850			ret = imx334_update_controls(imx334, mode);
   851			if (!ret)
   852				imx334->cur_mode = mode;
   853		}
   854	
   855		mutex_unlock(&imx334->mutex);
   856	
   857		return ret;
   858	}
   859	

-- 
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