From 85de5e069a394b60bfa605086bae136da19a70fb Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Sat, 20 Oct 2018 10:26:25 -0400 Subject: [PATCH] media: v4l2-common: add V4L2_FRACT_COMPARE Add macro to compare two v4l2_fract values in v4l2 common internal API. The same macro FRACT_CMP() is used by vivid and bcm2835-camera. This just renames it to V4L2_FRACT_COMPARE in order to avoid namespace collision. Cc: Matt Ranostay Acked-by: Sakari Ailus Signed-off-by: Akinobu Mita Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-common.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 82715645617b..0c511ed8ffb0 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h @@ -396,4 +396,9 @@ int v4l2_g_parm_cap(struct video_device *vdev, int v4l2_s_parm_cap(struct video_device *vdev, struct v4l2_subdev *sd, struct v4l2_streamparm *a); +/* Compare two v4l2_fract structs */ +#define V4L2_FRACT_COMPARE(a, OP, b) \ + ((u64)(a).numerator * (b).denominator OP \ + (u64)(b).numerator * (a).denominator) + #endif /* V4L2_COMMON_H_ */