From 09dbfced9499cf7810d4906918dbc1e817bcbeb4 Mon Sep 17 00:00:00 2001 From: "woncheon.an" Date: Mon, 6 Feb 2017 17:07:43 +0900 Subject: [PATCH] [COMMON] media: scaler: delete unnecessary check code Minumum size of Src is 16x16 and minimum size of Dst is 4x4. So deleted check code is always false Therefore Src->Dst scaling ratio check code is unnecessary Change-Id: I383e0765a4db33ff337fb675c07e145c4ca5ec37 Signed-off-by: woncheon.an --- .../platform/exynos/scaler/scaler-core.c | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/drivers/media/platform/exynos/scaler/scaler-core.c b/drivers/media/platform/exynos/scaler/scaler-core.c index ee56fa700887..ea01d5c66bed 100644 --- a/drivers/media/platform/exynos/scaler/scaler-core.c +++ b/drivers/media/platform/exynos/scaler/scaler-core.c @@ -1345,32 +1345,14 @@ static int sc_prepare_2nd_scaling(struct sc_ctx *ctx, if (*v_ratio > SCALE_RATIO_CONST(4, 1)) crop.height = ((src_height + 7) / 8) * 2; - if (crop.height < limit->min_h) { - if (SCALE_RATIO(limit->min_h, ctx->d_frame.crop.height) - > SCALE_RATIO_CONST(4, 1)) { - dev_err(sc->dev, "Failed height scale down %d -> %d\n", - src_height, ctx->d_frame.crop.height); - - free_intermediate_frame(ctx); - return -EINVAL; - } + if (crop.height < limit->min_h) crop.height = limit->min_h; - } if (*h_ratio > SCALE_RATIO_CONST(4, 1)) crop.width = ((src_width + 7) / 8) * 2; - if (crop.width < limit->min_w) { - if (SCALE_RATIO(limit->min_w, ctx->d_frame.crop.width) - > SCALE_RATIO_CONST(4, 1)) { - dev_err(sc->dev, "Failed width scale down %d -> %d\n", - src_width, ctx->d_frame.crop.width); - - free_intermediate_frame(ctx); - return -EINVAL; - } + if (crop.width < limit->min_w) crop.width = limit->min_w; - } if (*v_ratio < SCALE_RATIO_CONST(1, 8)) { crop.height = src_height * 8; -- 2.20.1