linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Tomasz Figa <tomasz.figa@gmail.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Kukjin Kim <kgene@kernel.org>,
	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	[thread overview]
Message-ID: <20170523184141.24284-3-krzk@kernel.org> (raw)
In-Reply-To: <20170523184141.24284-1-krzk@kernel.org>

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] <asn:2>*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 <krzk@kernel.org>
---
 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;
-- 
2.9.3

  parent reply	other threads:[~2017-05-23 18:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23 18:41 [PATCH 1/3] pinctrl: samsung: Constify wakeup driver specific data Krzysztof Kozlowski
2017-05-23 18:41 ` [PATCH 2/3] pinctrl: samsung: Handle memory allocation failure during wakeup banks init Krzysztof Kozlowski
2017-05-23 18:41 ` Krzysztof Kozlowski [this message]
2017-05-29  9:34 ` [PATCH 1/3] pinctrl: samsung: Constify wakeup driver specific data Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170523184141.24284-3-krzk@kernel.org \
    --to=krzk@kernel.org \
    --cc=kgene@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=tomasz.figa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).