Skip to content

Commit

Permalink
[media] drivers/media/video/s5p-fimc/fimc-capture.c: adjust double test
Browse files Browse the repository at this point in the history
Rewrite a duplicated test to test the correct value

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression E;
@@

(
* E
  || ... || E
|
* E
  && ... && E
)
// </smpl>

Signed-off-by: Julia Lawall <[email protected]>
Acked-by: Kyungmin Park <[email protected]>
Signed-off-by: Marek Szyprowski <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
JuliaLawall authored and Mauro Carvalho Chehab committed Jan 18, 2012
1 parent 53e5ab9 commit b1aa608
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/media/video/s5p-fimc/fimc-capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ static int fimc_pipeline_try_format(struct fimc_ctx *ctx,
mf->code = 0;
continue;
}
if (mf->width != tfmt->width || mf->width != tfmt->width) {
if (mf->width != tfmt->width || mf->height != tfmt->height) {
u32 fcc = ffmt->fourcc;
tfmt->width = mf->width;
tfmt->height = mf->height;
Expand All @@ -702,15 +702,16 @@ static int fimc_pipeline_try_format(struct fimc_ctx *ctx,
NULL, &fcc, FIMC_SD_PAD_SOURCE);
if (ffmt && ffmt->mbus_code)
mf->code = ffmt->mbus_code;
if (mf->width != tfmt->width || mf->width != tfmt->width)
if (mf->width != tfmt->width ||
mf->height != tfmt->height)
continue;
tfmt->code = mf->code;
}
if (csis)
ret = v4l2_subdev_call(csis, pad, set_fmt, NULL, &sfmt);

if (mf->code == tfmt->code &&
mf->width == tfmt->width && mf->width == tfmt->width)
mf->width == tfmt->width && mf->height == tfmt->height)
break;
}

Expand Down

0 comments on commit b1aa608

Please sign in to comment.