Re: [PATCH v2 25/25] media: i2c: imx283: Simplify VFLIP control setting

From: kernel test robot

Date: Fri Feb 13 2026 - 18:21:19 EST


Hi Kieran,

kernel test robot noticed the following build errors:

[auto build test ERROR on c824345288d11e269ce41b36c105715bc2286050]

url: https://github.com/intel-lab-lkp/linux/commits/Kieran-Bingham/media-i2c-imx283-Report-correct-V4L2_SEL_TGT_CROP/20260213-221320
base: c824345288d11e269ce41b36c105715bc2286050
patch link: https://lore.kernel.org/r/20260213-mainline-imx283-v2-v2-25-be40a3770ebf%40ideasonboard.com
patch subject: [PATCH v2 25/25] media: i2c: imx283: Simplify VFLIP control setting
config: openrisc-randconfig-r071-20260214 (https://download.01.org/0day-ci/archive/20260214/202602140716.ayhsqB6c-lkp@xxxxxxxxx/config)
compiler: or1k-linux-gcc (GCC) 9.5.0
smatch version: v0.5.0-8994-gd50c5a4c
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260214/202602140716.ayhsqB6c-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/202602140716.ayhsqB6c-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

drivers/media/i2c/imx283.c: In function 'imx283_set_ctrl':
>> drivers/media/i2c/imx283.c:951:3: error: a label can only be part of a statement and a declaration is not a statement
951 | u8 trim = IMX283_HTRIMMING_EN;
| ^~


vim +951 drivers/media/i2c/imx283.c

850
851 static int imx283_set_ctrl(struct v4l2_ctrl *ctrl)
852 {
853 struct imx283 *imx283 = container_of(ctrl->handler, struct imx283,
854 ctrl_handler);
855 const struct imx283_mode *mode;
856 struct v4l2_mbus_framefmt *fmt;
857 const struct imx283_mode *mode_list;
858 struct v4l2_subdev_state *state;
859 unsigned int num_modes;
860 u64 shr;
861 int ret = 0;
862
863 state = v4l2_subdev_get_locked_active_state(&imx283->sd);
864 fmt = v4l2_subdev_state_get_format(state, 0);
865
866 get_mode_table(fmt->code, &mode_list, &num_modes);
867 mode = v4l2_find_nearest_size(mode_list, num_modes, width, height,
868 fmt->width, fmt->height);
869
870 /*
871 * The VBLANK/HBLANK controls change the limits of usable exposure,
872 * so check and adjust if necessary.
873 */
874 if (ctrl->id == V4L2_CID_HBLANK) {
875 u64 pixel_rate = imx283_pixel_rate(imx283, mode);
876 u32 max_width = mode->crop.width + ctrl->val;
877
878 imx283->hmax = imx283_internal_clock(pixel_rate, max_width);
879 }
880
881 if (ctrl->id == V4L2_CID_VBLANK)
882 imx283->vmax = mode->crop.height + ctrl->val;
883
884 if (ctrl->id == V4L2_CID_HBLANK ||
885 ctrl->id == V4L2_CID_VBLANK) {
886 /* Honour the VBLANK limits when setting exposure. */
887 s64 current_exposure, max_exposure, min_exposure;
888
889 imx283_exposure_limits(imx283, mode,
890 &min_exposure, &max_exposure);
891
892 current_exposure = imx283->exposure->val;
893 current_exposure = clamp(current_exposure, min_exposure,
894 max_exposure);
895
896 __v4l2_ctrl_modify_range(imx283->exposure, min_exposure,
897 max_exposure, 1, current_exposure);
898 }
899
900 /*
901 * Applying V4L2 control value only happens
902 * when power is up for streaming
903 */
904 if (!pm_runtime_get_if_active(imx283->dev))
905 return 0;
906
907 switch (ctrl->id) {
908 case V4L2_CID_EXPOSURE:
909 shr = imx283_shr(imx283, mode, ctrl->val);
910 dev_dbg(imx283->dev, "V4L2_CID_EXPOSURE : %d - SHR: %lld\n",
911 ctrl->val, shr);
912 ret = cci_write(imx283->cci, IMX283_REG_SHR, shr, NULL);
913 break;
914
915 case V4L2_CID_HBLANK:
916 dev_dbg(imx283->dev, "V4L2_CID_HBLANK : %d HMAX : %u\n",
917 ctrl->val, imx283->hmax);
918 ret = cci_write(imx283->cci, IMX283_REG_HMAX, imx283->hmax, NULL);
919
920 /* Recompute the SHR based on the new timings */
921 shr = imx283_shr(imx283, mode, imx283->exposure->val);
922 cci_write(imx283->cci, IMX283_REG_SHR, shr, &ret);
923
924 break;
925
926 case V4L2_CID_VBLANK:
927 imx283->vmax = mode->crop.height + ctrl->val;
928 dev_dbg(imx283->dev, "V4L2_CID_VBLANK : %d VMAX : %u\n",
929 ctrl->val, imx283->vmax);
930 ret = cci_write(imx283->cci, IMX283_REG_VMAX, imx283->vmax, NULL);
931
932 /* Recompute the SHR based on the new timings */
933 shr = imx283_shr(imx283, mode, imx283->exposure->val);
934 cci_write(imx283->cci, IMX283_REG_SHR, shr, &ret);
935
936 break;
937
938 case V4L2_CID_ANALOGUE_GAIN:
939 ret = cci_write(imx283->cci, IMX283_REG_ANALOG_GAIN, ctrl->val, NULL);
940 break;
941
942 case V4L2_CID_DIGITAL_GAIN:
943 ret = cci_write(imx283->cci, IMX283_REG_DIGITAL_GAIN, ctrl->val, NULL);
944 break;
945
946 case V4L2_CID_VFLIP:
947 /*
948 * VFLIP is managed by BIT(0) of IMX283_REG_HTRIMMING address, hence
949 * both need to be set simultaneously.
950 */
> 951 u8 trim = IMX283_HTRIMMING_EN;
952
953 trim |= ctrl->val ? IMX283_MDVREV : 0;
954 cci_write(imx283->cci, IMX283_REG_HTRIMMING, trim, &ret);
955
956 break;
957
958 case V4L2_CID_TEST_PATTERN:
959 ret = imx283_update_test_pattern(imx283, ctrl->val);
960 break;
961
962 default:
963 dev_err(imx283->dev, "ctrl(id:0x%x, val:0x%x) is not handled\n",
964 ctrl->id, ctrl->val);
965 break;
966 }
967
968 pm_runtime_put(imx283->dev);
969
970 return ret;
971 }
972

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