diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2008-12-18 09:51:55 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:40:21 -0500 |
commit | 64f5905ee74906643e22657bd20e2f11443053f0 (patch) | |
tree | 17aaf01284c3297d835f3167098be9333df9b188 /drivers/media/video/mt9m111.c | |
parent | 9414de39e8e07d90bdb6524be501fae0e013d37b (diff) |
V4L/DVB (10080): soc-camera: readability improvements, more strict operations checks
Simplify multiple drivers by replacing f->fmt.pix.* with a single pointer
dereference, merge some needlessly broken lines, verify host and camera
operations pointers on registration.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/mt9m111.c')
-rw-r--r-- | drivers/media/video/mt9m111.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c index 3dfeea4e94b1..c89ea41fe259 100644 --- a/drivers/media/video/mt9m111.c +++ b/drivers/media/video/mt9m111.c | |||
@@ -503,10 +503,12 @@ static int mt9m111_set_fmt(struct soc_camera_device *icd, | |||
503 | static int mt9m111_try_fmt(struct soc_camera_device *icd, | 503 | static int mt9m111_try_fmt(struct soc_camera_device *icd, |
504 | struct v4l2_format *f) | 504 | struct v4l2_format *f) |
505 | { | 505 | { |
506 | if (f->fmt.pix.height > MT9M111_MAX_HEIGHT) | 506 | struct v4l2_pix_format *pix = &f->fmt.pix; |
507 | f->fmt.pix.height = MT9M111_MAX_HEIGHT; | 507 | |
508 | if (f->fmt.pix.width > MT9M111_MAX_WIDTH) | 508 | if (pix->height > MT9M111_MAX_HEIGHT) |
509 | f->fmt.pix.width = MT9M111_MAX_WIDTH; | 509 | pix->height = MT9M111_MAX_HEIGHT; |
510 | if (pix->width > MT9M111_MAX_WIDTH) | ||
511 | pix->width = MT9M111_MAX_WIDTH; | ||
510 | 512 | ||
511 | return 0; | 513 | return 0; |
512 | } | 514 | } |