From patchwork Mon Feb 15 20:01:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Parrot X-Patchwork-Id: 8318271 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EEB38C02AA for ; Mon, 15 Feb 2016 20:02:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D64120361 for ; Mon, 15 Feb 2016 20:02:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 215832034C for ; Mon, 15 Feb 2016 20:02:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752146AbcBOUBt (ORCPT ); Mon, 15 Feb 2016 15:01:49 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:52527 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751910AbcBOUBs (ORCPT ); Mon, 15 Feb 2016 15:01:48 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id u1FK1lU2000447; Mon, 15 Feb 2016 14:01:47 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u1FK1lU9000906; Mon, 15 Feb 2016 14:01:47 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Mon, 15 Feb 2016 14:01:46 -0600 Received: from tct7400.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u1FK1lUR011713; Mon, 15 Feb 2016 14:01:47 -0600 From: Benoit Parrot To: Hans Verkuil CC: , Subject: [Patch] media: ti-vpe: cal: Fix syntax check warnings Date: Mon, 15 Feb 2016 14:01:42 -0600 Message-ID: <1455566502-29576-1-git-send-email-bparrot@ti.com> X-Mailer: git-send-email 1.8.5.1 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix the following sparse warnings: ti-vpe/cal.c:387:26: warning: incorrect type in return expression (different address spaces) ti-vpe/cal.c:459:26: warning: incorrect type in return expression (different address spaces) ti-vpe/cal.c:503:27: warning: incorrect type in argument 6 (different address spaces) ti-vpe/cal.c:509:47: warning: incorrect type in argument 6 (different address spaces) ti-vpe/cal.c:518:47: warning: incorrect type in argument 6 (different address spaces) ti-vpe/cal.c:526:31: warning: incorrect type in argument 6 (different address spaces) ti-vpe/cal.c:1807:24: warning: Using plain integer as NULL pointer ti-vpe/cal.c:1844:16: warning: Using plain integer as NULL pointer Signed-off-by: Benoit Parrot --- drivers/media/platform/ti-vpe/cal.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c index 69ec79ba49ee..35fa1071c5b2 100644 --- a/drivers/media/platform/ti-vpe/cal.c +++ b/drivers/media/platform/ti-vpe/cal.c @@ -384,7 +384,7 @@ static struct cm_data *cm_create(struct cal_dev *dev) cm->base = devm_ioremap_resource(&pdev->dev, cm->res); if (IS_ERR(cm->base)) { cal_err(dev, "failed to ioremap\n"); - return cm->base; + return ERR_CAST(cm->base); } cal_dbg(1, dev, "ioresource %s at %pa - %pa\n", @@ -456,7 +456,7 @@ static struct cc_data *cc_create(struct cal_dev *dev, unsigned int core) cc->base = devm_ioremap_resource(&pdev->dev, cc->res); if (IS_ERR(cc->base)) { cal_err(dev, "failed to ioremap\n"); - return cc->base; + return ERR_CAST(cc->base); } cal_dbg(1, dev, "ioresource %s at %pa - %pa\n", @@ -500,13 +500,14 @@ static void cal_quickdump_regs(struct cal_dev *dev) { cal_info(dev, "CAL Registers @ 0x%pa:\n", &dev->res->start); print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 4, - dev->base, resource_size(dev->res), false); + (__force const void *)dev->base, + resource_size(dev->res), false); if (dev->ctx[0]) { cal_info(dev, "CSI2 Core 0 Registers @ %pa:\n", &dev->ctx[0]->cc->res->start); print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 4, - dev->ctx[0]->cc->base, + (__force const void *)dev->ctx[0]->cc->base, resource_size(dev->ctx[0]->cc->res), false); } @@ -515,7 +516,7 @@ static void cal_quickdump_regs(struct cal_dev *dev) cal_info(dev, "CSI2 Core 1 Registers @ %pa:\n", &dev->ctx[1]->cc->res->start); print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 4, - dev->ctx[1]->cc->base, + (__force const void *)dev->ctx[1]->cc->base, resource_size(dev->ctx[1]->cc->res), false); } @@ -523,7 +524,7 @@ static void cal_quickdump_regs(struct cal_dev *dev) cal_info(dev, "CAMERRX_Control Registers @ %pa:\n", &dev->cm->res->start); print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 4, - dev->cm->base, + (__force const void *)dev->cm->base, resource_size(dev->cm->res), false); } @@ -1804,7 +1805,7 @@ static struct cal_ctx *cal_create_instance(struct cal_dev *dev, int inst) ctx = devm_kzalloc(&dev->pdev->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) - return 0; + return NULL; /* save the cal_dev * for future ref */ ctx->dev = dev; @@ -1841,7 +1842,7 @@ free_hdl: unreg_dev: v4l2_device_unregister(&ctx->v4l2_dev); err_exit: - return 0; + return NULL; } static int cal_probe(struct platform_device *pdev)