summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2018-03-21 16:29:27 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-04-04 06:12:53 -0400
commitd2dc57b10ae2bd2e2e92ce26f2aaf24bcee17c53 (patch)
treef59cdab6eda07f590b9d2c54408ac3b387ea32cd /include/media
parentdd5747fb9235d28ac2534e0ad4826a810a93e003 (diff)
media: v4l: Bring back array_size parameter to v4l2_find_nearest_size
An older version of the driver patches were merged accidentally which resulted in missing the array_size parameter that tells the length of the array that contains the different supported sizes. Bring it back to v4l2_find_nearest size and make the corresponding change for the drivers using it as well. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/v4l2-common.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 54b689247937..160bca96d524 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -320,6 +320,7 @@ void v4l_bound_align_image(unsigned int *width, unsigned int wmin,
320 * set of resolutions contained in an array of a driver specific struct. 320 * set of resolutions contained in an array of a driver specific struct.
321 * 321 *
322 * @array: a driver specific array of image sizes 322 * @array: a driver specific array of image sizes
323 * @array_size: the length of the driver specific array of image sizes
323 * @width_field: the name of the width field in the driver specific struct 324 * @width_field: the name of the width field in the driver specific struct
324 * @height_field: the name of the height field in the driver specific struct 325 * @height_field: the name of the height field in the driver specific struct
325 * @width: desired width. 326 * @width: desired width.
@@ -332,13 +333,13 @@ void v4l_bound_align_image(unsigned int *width, unsigned int wmin,
332 * 333 *
333 * Returns the best match or NULL if the length of the array is zero. 334 * Returns the best match or NULL if the length of the array is zero.
334 */ 335 */
335#define v4l2_find_nearest_size(array, width_field, height_field, \ 336#define v4l2_find_nearest_size(array, array_size, width_field, height_field, \
336 width, height) \ 337 width, height) \
337 ({ \ 338 ({ \
338 BUILD_BUG_ON(sizeof((array)->width_field) != sizeof(u32) || \ 339 BUILD_BUG_ON(sizeof((array)->width_field) != sizeof(u32) || \
339 sizeof((array)->height_field) != sizeof(u32)); \ 340 sizeof((array)->height_field) != sizeof(u32)); \
340 (typeof(&(*(array))))__v4l2_find_nearest_size( \ 341 (typeof(&(*(array))))__v4l2_find_nearest_size( \
341 (array), ARRAY_SIZE(array), sizeof(*(array)), \ 342 (array), array_size, sizeof(*(array)), \
342 offsetof(typeof(*(array)), width_field), \ 343 offsetof(typeof(*(array)), width_field), \
343 offsetof(typeof(*(array)), height_field), \ 344 offsetof(typeof(*(array)), height_field), \
344 width, height); \ 345 width, height); \