Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2bbc46e8 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

media: v4l-common: Make v4l2_find_nearest_size more sparse-friendly



This sparse warning is emitted by using v4l2_find_nearest_size in some
cases. Fix it in the framework.

>> drivers/media/i2c/ov5640.c:1394:14: sparse: incorrect type in assignment
+(different base types) @@    expected struct ov5640_mode_info const *mode @@
+got ststruct ov5640_mode_info const *mode @@
   drivers/media/i2c/ov5640.c:1394:14:    expected struct ov5640_mode_info const
+*mode
   drivers/media/i2c/ov5640.c:1394:14:    got struct ov5640_mode_info const ( *<
+noident> )[9]

Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 41cb1c73
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -338,7 +338,7 @@ void v4l_bound_align_image(unsigned int *width, unsigned int wmin,
	({								\
		BUILD_BUG_ON(sizeof((array)->width_field) != sizeof(u32) || \
			     sizeof((array)->height_field) != sizeof(u32)); \
		(typeof(&(*(array))))__v4l2_find_nearest_size(		\
		(typeof(&(array)[0]))__v4l2_find_nearest_size(		\
			(array), array_size, sizeof(*(array)),		\
			offsetof(typeof(*(array)), width_field),	\
			offsetof(typeof(*(array)), height_field),	\