Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: i2c: imx219: Move variables to inner scope

The exposure_max, exposure_def and hblank variables are only used in an
inner scope in the imx219_set_pad_format() function. Move them to that
scope to keep them closer to their usage and improve readability.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Laurent Pinchart and committed by
Hans Verkuil
ef202378 bf313f99

+4 -1
+4 -1
drivers/media/i2c/imx219.c
··· 815 815 { 816 816 struct imx219 *imx219 = to_imx219(sd); 817 817 const struct imx219_mode *mode; 818 - int exposure_max, exposure_def, hblank; 819 818 struct v4l2_mbus_framefmt *format; 820 819 struct v4l2_rect *crop; 821 820 unsigned int bin_h, bin_v; ··· 843 844 crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; 844 845 845 846 if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { 847 + int exposure_max; 848 + int exposure_def; 849 + int hblank; 850 + 846 851 /* Update limits and set FPS to default */ 847 852 __v4l2_ctrl_modify_range(imx219->vblank, IMX219_VBLANK_MIN, 848 853 IMX219_VTS_MAX - mode->height, 1,