summaryrefslogtreecommitdiff
path: root/drivers/media/v4l2-core/v4l2-dv-timings.c
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2015-06-10 19:32:33 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-07-06 14:25:48 +0300
commitfd7524294ccaa6168593042121e3bbd26a529fd5 (patch)
treeed7cb146b6da1eaca62479b5e48d51dfcb2dea56 /drivers/media/v4l2-core/v4l2-dv-timings.c
parentcfcffe397fae05d6193bbb0dc87a7148323bf3fb (diff)
downloadlinux-fd7524294ccaa6168593042121e3bbd26a529fd5.tar.xz
[media] v4l2-dv-timings: use swap() in v4l2_calc_aspect_ratio()
Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-dv-timings.c')
-rw-r--r--drivers/media/v4l2-core/v4l2-dv-timings.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b/drivers/media/v4l2-core/v4l2-dv-timings.c
index 04dc71e3ebf0..eefad4f17497 100644
--- a/drivers/media/v4l2-core/v4l2-dv-timings.c
+++ b/drivers/media/v4l2-core/v4l2-dv-timings.c
@@ -665,7 +665,6 @@ EXPORT_SYMBOL_GPL(v4l2_detect_gtf);
struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait)
{
struct v4l2_fract aspect = { 16, 9 };
- u32 tmp;
u8 ratio;
/* Nothing filled in, fallback to 16:9 */
@@ -697,9 +696,7 @@ struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait)
if (hor_landscape)
return aspect;
/* The aspect ratio is for portrait, so swap numerator and denominator */
- tmp = aspect.denominator;
- aspect.denominator = aspect.numerator;
- aspect.numerator = tmp;
+ swap(aspect.denominator, aspect.numerator);
return aspect;
}
EXPORT_SYMBOL_GPL(v4l2_calc_aspect_ratio);