From patchwork Tue May 23 18:41:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9743199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 68AE26037F for ; Tue, 23 May 2017 18:42:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AE882873C for ; Tue, 23 May 2017 18:42:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F7BF28752; Tue, 23 May 2017 18:42:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDF132873C for ; Tue, 23 May 2017 18:42:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763718AbdEWSmD (ORCPT ); Tue, 23 May 2017 14:42:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:37934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762602AbdEWSlz (ORCPT ); Tue, 23 May 2017 14:41:55 -0400 Received: from kozik-lap.dzcmts001-cpe-001.datazug.ch (pub082136089155.dh-hfc.datazug.ch [82.136.89.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BEBD3239D5; Tue, 23 May 2017 18:41:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BEBD3239D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=krzk@kernel.org From: Krzysztof Kozlowski To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij , Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] pinctrl: samsung: Explicitly cast pointer returned by of_iomap() to iomem Date: Tue, 23 May 2017 20:41:41 +0200 Message-Id: <20170523184141.24284-3-krzk@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170523184141.24284-1-krzk@kernel.org> References: <20170523184141.24284-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For S5Pv210 retention control, the driver stores the iomem pointer from of_iomap() under void pointer priv member. This makes sparse unhappy: drivers/pinctrl/samsung/pinctrl-exynos.c:664:36: warning: incorrect type in argument 1 (different address spaces) drivers/pinctrl/samsung/pinctrl-exynos.c:664:36: expected void const volatile [noderef] *addr drivers/pinctrl/samsung/pinctrl-exynos.c:664:36: got void * The iomem pointer is used safely (stored under priv by s5pv210_retention_init(), used by s5pv210_retention_disable() thus we can add explicit casts to iomem silence the warning. Signed-off-by: Krzysztof Kozlowski --- drivers/pinctrl/samsung/pinctrl-exynos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 66122627b3ed..a870af943bc7 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -656,7 +656,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) static void s5pv210_retention_disable(struct samsung_pinctrl_drv_data *drvdata) { - void *clk_base = drvdata->retention_ctrl->priv; + void __iomem *clk_base = (void __iomem *)drvdata->retention_ctrl->priv; u32 tmp; tmp = __raw_readl(clk_base + S5P_OTHERS); @@ -671,7 +671,7 @@ s5pv210_retention_init(struct samsung_pinctrl_drv_data *drvdata, { struct samsung_retention_ctrl *ctrl; struct device_node *np; - void *clk_base; + void __iomem *clk_base; ctrl = devm_kzalloc(drvdata->dev, sizeof(*ctrl), GFP_KERNEL); if (!ctrl) @@ -690,7 +690,7 @@ s5pv210_retention_init(struct samsung_pinctrl_drv_data *drvdata, return ERR_PTR(-EINVAL); } - ctrl->priv = clk_base; + ctrl->priv = (void __force *)clk_base; ctrl->disable = s5pv210_retention_disable; return ctrl;