From patchwork Mon Oct 1 12:52:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 1531351 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by patchwork1.kernel.org (Postfix) with ESMTP id E272E3FE1C for ; Mon, 1 Oct 2012 12:55:34 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q91Criv5015873; Mon, 1 Oct 2012 07:53:44 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q91Cri2f011697; Mon, 1 Oct 2012 07:53:44 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Mon, 1 Oct 2012 07:53:44 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id q91CriPh007919; Mon, 1 Oct 2012 07:53:44 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 44BF180627; Mon, 1 Oct 2012 07:53:44 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 3176580626 for ; Mon, 1 Oct 2012 07:53:43 -0500 (CDT) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflp51.itg.ti.com (8.13.7/8.13.8) with ESMTP id q91Crghi003636 for ; Mon, 1 Oct 2012 07:53:42 -0500 (CDT) Received: from psmtp.com (na3sys009amx228.postini.com [74.125.149.112]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id q91CrgqJ017075 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 1 Oct 2012 07:53:42 -0500 Received: from mail-pb0-f45.google.com ([209.85.160.45]) (using TLSv1) by na3sys009amx228.postini.com ([74.125.148.10]) with SMTP; Mon, 01 Oct 2012 08:53:42 EDT Received: by pbbrp2 with SMTP id rp2so7758909pbb.4 for ; Mon, 01 Oct 2012 05:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=Lnss8IDfbK3W3FXCqzUo0iSr6hJTTMemUuYYenqGUng=; b=A0PGGM3qX4SLWk18WSRIRHkKLScpX8tYEiIBvPGL5brk0Rhf/2RLLpiEvQUTjAjYwt LrhNEDPusON5DNj3Mmvhy3oaoUM5VZkfi0iVYKUZbzgvo92s313fp0nJRQ5VftzVy3ji EpoyWCzHMETdpbVPF4BvgEWXowAmR0C+1Ktz0FnoLKnGLPVBgaGcok8PP7l7s9d7eT4h ygggTIVf+096hEcNe4HBYIXiAjsxqzPYMIDyX9Vcj1VtNr7kiuhXMXODmKmPlVuTlKqF FFUMyWpNY7Ul7fMIm9pZ8wKAjDTgdGzR+rtOCXA2HjphlbZZz/K0zss8SpGBtliwNgWz AcjA== Received: by 10.68.138.163 with SMTP id qr3mr40682501pbb.161.1349096021549; Mon, 01 Oct 2012 05:53:41 -0700 (PDT) Received: from localhost.localdomain ([117.221.42.190]) by mx.google.com with ESMTPS id nu8sm10249705pbc.45.2012.10.01.05.53.25 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 01 Oct 2012 05:53:40 -0700 (PDT) From: Prabhakar To: LMML Subject: [PATCH] media: davinci: vpfe: fix build error Date: Mon, 1 Oct 2012 18:22:48 +0530 Message-ID: <1349095968-14257-1-git-send-email-prabhakar.lad@ti.com> X-Mailer: git-send-email 1.7.4.1 X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:69.48419/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-dkim: 1 skipped:not-enabled X-pstn-settings: 2 (0.5000:0.0050) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [82/3] CC: DLOS , Hans Verkuil , VGER X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Lad, Prabhakar recent patch with commit id 4f996594ceaf6c3f9bc42b40c40b0f7f87b79c86 which makes vidioc_s_crop const, was causing a following build error. vpfe_capture.c: In function 'vpfe_s_crop': vpfe_capture.c:1695: error: assignment of read-only location '*crop' vpfe_capture.c:1706: warning: passing argument 1 of 'ccdc_dev->hw_ops.set_image_window' discards qualifiers from pointer target type vpfe_capture.c:1706: note: expected 'struct v4l2_rect *' but argument is of type 'const struct v4l2_rect *' make[4]: *** [drivers/media/platform/davinci/vpfe_capture.o] Error 1 Signed-off-by: Lad, Prabhakar Signed-off-by: Manjunath Hadli Cc: Hans Verkuil Acked-by: Hans Verkuil --- drivers/media/platform/davinci/vpfe_capture.c | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index 48052cb..8be492c 100644 --- a/drivers/media/platform/davinci/vpfe_capture.c +++ b/drivers/media/platform/davinci/vpfe_capture.c @@ -1669,6 +1669,7 @@ static int vpfe_s_crop(struct file *file, void *priv, const struct v4l2_crop *crop) { struct vpfe_device *vpfe_dev = video_drvdata(file); + struct v4l2_rect rect = crop->c; int ret = 0; v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_s_crop\n"); @@ -1684,7 +1685,7 @@ static int vpfe_s_crop(struct file *file, void *priv, if (ret) return ret; - if (crop->c.top < 0 || crop->c.left < 0) { + if (rect.top < 0 || rect.left < 0) { v4l2_err(&vpfe_dev->v4l2_dev, "doesn't support negative values for top & left\n"); ret = -EINVAL; @@ -1692,26 +1693,26 @@ static int vpfe_s_crop(struct file *file, void *priv, } /* adjust the width to 16 pixel boundary */ - crop->c.width = ((crop->c.width + 15) & ~0xf); + rect.width = ((rect.width + 15) & ~0xf); /* make sure parameters are valid */ - if ((crop->c.left + crop->c.width > + if ((rect.left + rect.width > vpfe_dev->std_info.active_pixels) || - (crop->c.top + crop->c.height > + (rect.top + rect.height > vpfe_dev->std_info.active_lines)) { v4l2_err(&vpfe_dev->v4l2_dev, "Error in S_CROP params\n"); ret = -EINVAL; goto unlock_out; } - ccdc_dev->hw_ops.set_image_window(&crop->c); - vpfe_dev->fmt.fmt.pix.width = crop->c.width; - vpfe_dev->fmt.fmt.pix.height = crop->c.height; + ccdc_dev->hw_ops.set_image_window(&rect); + vpfe_dev->fmt.fmt.pix.width = rect.width; + vpfe_dev->fmt.fmt.pix.height = rect.height; vpfe_dev->fmt.fmt.pix.bytesperline = ccdc_dev->hw_ops.get_line_length(); vpfe_dev->fmt.fmt.pix.sizeimage = vpfe_dev->fmt.fmt.pix.bytesperline * vpfe_dev->fmt.fmt.pix.height; - vpfe_dev->crop = crop->c; + vpfe_dev->crop = rect; unlock_out: mutex_unlock(&vpfe_dev->lock); return ret;