From patchwork Tue Oct 2 08:57:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 1536511 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B57D8DF238 for ; Tue, 2 Oct 2012 08:57:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754914Ab2JBI5h (ORCPT ); Tue, 2 Oct 2012 04:57:37 -0400 Received: from ams-iport-3.cisco.com ([144.254.224.146]:39934 "EHLO ams-iport-3.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754916Ab2JBI5e (ORCPT ); Tue, 2 Oct 2012 04:57:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2841; q=dns/txt; s=iport; t=1349168254; x=1350377854; h=from:to:cc:subject:date:message-id; bh=/IeBVcmRms1C7EJjwX3rYOn/TYXqro0EwgRcMC19YUE=; b=Uju2yApPj8c6I7ITMITGSQKRFzHbYnMsg6dWRtpSDPDDEW+kKuxaxazD j+3s/Fyc+sSZ+Stx4iuWC8Lq8A/AWLFockl3jF2TNjkyV1c1+hVtmD24I a1GqpnmnpJ7/vzu+U+jp/f+ppTHyUQk/iGF1TMBvD28Cir4+irpz5VldE I=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAMCralCQ/khM/2dsb2JhbABFvlmBCIIhAQEEEgEUUhAfMlcZIodjmWGPVpBsixqDK4MgA5VpjkKBaYJp X-IronPort-AV: E=Sophos;i="4.80,522,1344211200"; d="scan'208";a="8459175" Received: from ams-core-3.cisco.com ([144.254.72.76]) by ams-iport-3.cisco.com with ESMTP; 02 Oct 2012 08:57:32 +0000 Received: from cobaltpc1.cisco.com (dhcp-10-54-92-107.cisco.com [10.54.92.107]) by ams-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id q928vV3B013709; Tue, 2 Oct 2012 08:57:32 GMT From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Anatolij Gustschin , Sylwester Nawrocki Subject: [RFC PATCH 2/3] s5p-fimc: fix compiler warning Date: Tue, 2 Oct 2012 10:57:19 +0200 Message-Id: <6311a7c997a9020117d78855d80384468e585601.1349168132.git.hans.verkuil@cisco.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1349168240-29269-1-git-send-email-hans.verkuil@cisco.com> References: <1349168240-29269-1-git-send-email-hans.verkuil@cisco.com> In-Reply-To: <760bdb23b40b9ce3a8044a3379510889db4bfcf7.1349168132.git.hans.verkuil@cisco.com> References: <760bdb23b40b9ce3a8044a3379510889db4bfcf7.1349168132.git.hans.verkuil@cisco.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org drivers/media/platform/s5p-fimc/fimc-m2m.c:561:2: warning: passing argument 2 of 'fimc_m2m_try_crop' discards 'const' qualifier from pointer target type [enabled by default] drivers/media/platform/s5p-fimc/fimc-m2m.c:502:12: note: expected 'struct v4l2_crop *' but argument is of type 'const struct v4l2_crop *' This is fall-out from this commit: commit 4f996594ceaf6c3f9bc42b40c40b0f7f87b79c86 Author: Hans Verkuil Date: Wed Sep 5 05:10:48 2012 -0300 [media] v4l2: make vidioc_s_crop const Signed-off-by: Hans Verkuil --- drivers/media/platform/s5p-fimc/fimc-m2m.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/s5p-fimc/fimc-m2m.c b/drivers/media/platform/s5p-fimc/fimc-m2m.c index 51fc04c..03def3d 100644 --- a/drivers/media/platform/s5p-fimc/fimc-m2m.c +++ b/drivers/media/platform/s5p-fimc/fimc-m2m.c @@ -551,30 +551,31 @@ static int fimc_m2m_try_crop(struct fimc_ctx *ctx, struct v4l2_crop *cr) return 0; } -static int fimc_m2m_s_crop(struct file *file, void *fh, const struct v4l2_crop *cr) +static int fimc_m2m_s_crop(struct file *file, void *fh, const struct v4l2_crop *crop) { struct fimc_ctx *ctx = fh_to_ctx(fh); struct fimc_dev *fimc = ctx->fimc_dev; + struct v4l2_crop cr = *crop; struct fimc_frame *f; int ret; - ret = fimc_m2m_try_crop(ctx, cr); + ret = fimc_m2m_try_crop(ctx, &cr); if (ret) return ret; - f = (cr->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) ? + f = (cr.type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) ? &ctx->s_frame : &ctx->d_frame; /* Check to see if scaling ratio is within supported range */ if (fimc_ctx_state_is_set(FIMC_DST_FMT | FIMC_SRC_FMT, ctx)) { - if (cr->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { - ret = fimc_check_scaler_ratio(ctx, cr->c.width, - cr->c.height, ctx->d_frame.width, + if (cr.type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + ret = fimc_check_scaler_ratio(ctx, cr.c.width, + cr.c.height, ctx->d_frame.width, ctx->d_frame.height, ctx->rotation); } else { ret = fimc_check_scaler_ratio(ctx, ctx->s_frame.width, - ctx->s_frame.height, cr->c.width, - cr->c.height, ctx->rotation); + ctx->s_frame.height, cr.c.width, + cr.c.height, ctx->rotation); } if (ret) { v4l2_err(&fimc->m2m.vfd, "Out of scaler range\n"); @@ -582,10 +583,10 @@ static int fimc_m2m_s_crop(struct file *file, void *fh, const struct v4l2_crop * } } - f->offs_h = cr->c.left; - f->offs_v = cr->c.top; - f->width = cr->c.width; - f->height = cr->c.height; + f->offs_h = cr.c.left; + f->offs_v = cr.c.top; + f->width = cr.c.width; + f->height = cr.c.height; fimc_ctx_state_set(FIMC_PARAMS, ctx);