Re: [PATCH v2] media: i2c: imx219: implement v4l2 selection api

From: kernel test robot
Date: Wed Jan 10 2024 - 16:53:46 EST


Hi Vinay,

kernel test robot noticed the following build warnings:

[auto build test WARNING on media-tree/master]
[also build test WARNING on linuxtv-media-stage/master next-20240110]
[cannot apply to sailus-media-tree/streams linus/master v6.7]
[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/Vinay-Varma/media-i2c-imx219-implement-v4l2-selection-api/20240109-115310
base: git://linuxtv.org/media_tree.git master
patch link: https://lore.kernel.org/r/20240109035045.552097-1-varmavinaym%40gmail.com
patch subject: [PATCH v2] media: i2c: imx219: implement v4l2 selection api
config: x86_64-allmodconfig (https://download.01.org/0day-ci/archive/20240111/202401110518.L0kScfAo-lkp@xxxxxxxxx/config)
compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240111/202401110518.L0kScfAo-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401110518.L0kScfAo-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/media/i2c/imx219.c:950:29: warning: variable 'fmt' set but not used [-Wunused-but-set-variable]
950 | struct v4l2_mbus_framefmt *fmt;
| ^
1 warning generated.


vim +/fmt +950 drivers/media/i2c/imx219.c

937
938 #define IMX219_ROUND(dim, step, flags) \
939 ((flags) & V4L2_SEL_FLAG_GE ? \
940 round_up((dim), (step)) : \
941 ((flags) & V4L2_SEL_FLAG_LE ? \
942 round_down((dim), (step)) : \
943 round_down((dim) + (step) / 2, (step))))
944
945 static bool imx219_set_selection_crop(struct v4l2_subdev *sd,
946 struct v4l2_subdev_state *sd_state,
947 struct v4l2_subdev_selection *sel)
948 {
949 struct v4l2_rect *compose, *crop;
> 950 struct v4l2_mbus_framefmt *fmt;
951 u32 max_binning;
952
953 crop = v4l2_subdev_state_get_crop(sd_state, 0);
954 if (v4l2_rect_equal(&sel->r, crop))
955 return false;
956 max_binning = binning_ratios[ARRAY_SIZE(binning_ratios) - 1];
957 sel->r.width =
958 clamp(IMX219_ROUND(sel->r.width, max_binning, sel->flags),
959 max_binning * IMX219_MIN_COMPOSE_SIZE,
960 IMX219_PIXEL_ARRAY_WIDTH);
961 sel->r.height =
962 clamp(IMX219_ROUND(sel->r.width, max_binning, sel->flags),
963 max_binning * IMX219_MIN_COMPOSE_SIZE,
964 IMX219_PIXEL_ARRAY_WIDTH);
965 sel->r.left =
966 min_t(u32, sel->r.left, IMX219_PIXEL_ARRAY_LEFT - sel->r.width);
967 sel->r.top =
968 min_t(u32, sel->r.top, IMX219_PIXEL_ARRAY_TOP - sel->r.top);
969
970 compose = v4l2_subdev_state_get_compose(sd_state, 0);
971 fmt = v4l2_subdev_state_get_format(sd_state, 0);
972 *crop = sel->r;
973 compose->height = crop->height;
974 compose->width = crop->width;
975 return true;
976 }
977

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki