From: Julia Lawall Date: Thu, 12 Jan 2012 20:49:28 +0000 (-0300) Subject: [media] drivers/media/video/s5p-fimc/fimc-capture.c: adjust double test X-Git-Tag: upstream/snapshot3+hdmi~7520^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1aa60892ecc1ba03185e7dfed99cc9202ef03b7;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git [media] drivers/media/video/s5p-fimc/fimc-capture.c: adjust double test Rewrite a duplicated test to test the correct value The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression E; @@ ( * E || ... || E | * E && ... && E ) // Signed-off-by: Julia Lawall Acked-by: Kyungmin Park Signed-off-by: Marek Szyprowski Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c index 510cfab..a9e9653 100644 --- a/drivers/media/video/s5p-fimc/fimc-capture.c +++ b/drivers/media/video/s5p-fimc/fimc-capture.c @@ -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; @@ -702,7 +702,8 @@ 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; } @@ -710,7 +711,7 @@ static int fimc_pipeline_try_format(struct fimc_ctx *ctx, 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; }