From patchwork Fri Mar 1 08:09:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 159468 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp426341jad; Fri, 1 Mar 2019 00:09:26 -0800 (PST) X-Google-Smtp-Source: APXvYqxyoQgzPWeXep/O+zNGO1kiPZNQhkUwrNDIgwzTe7bSI24JuVRdZ8lGZ/RHt6XdTYZacN9K X-Received: by 2002:a65:60d8:: with SMTP id r24mr3659918pgv.6.1551427766460; Fri, 01 Mar 2019 00:09:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551427766; cv=none; d=google.com; s=arc-20160816; b=LBLDwoqbbLgRY3MiTg6NIT4a9aaToI7tfP8di/rRzjwISsYHxT0aUplQ7EYvS+/yyp n8QsC/c+/apb9XP3V1whxm9RPetV9EjlzPF349XbkRmAJPs/B/vMVg5gQwbeYxhVEM8M AbbaPomZsy4S/byrg2N+JGByw2jv+a13/1Qtq/Ph++WtxirJkeMzHr6dPSWOg3+Iws8G f+kW5gaqbCu7/cpqNJBdvk5mQU5yIRQ1cf628v6WIEpgtjFRgMPthP6PY501vROMKV5g CeS7fLZVubm4l4oAf/Qu57obzOZPKjELnnowb0fnV4HiPF5nQO08bltoupjsvkYAoaKN /iAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SkqwhcXWOdlo5SWMFzsf8cAndUwOztl1pjPAoff5TV8=; b=PeMpSIrpmv6pL7mkov9zSRHzg/Na5XxZNCD6yOt52ubTAcQXUfZ06TtSc7ylOJq2f7 9PrOUxxNYLGfmMK4RQEvixGHdQUZETUZf3ldlayBz4jVD9hYE3MH+zrTrodpJs96wDmu oKan7sZlUFuUdYuJfo+KzYTmLh4H83cS5FA4888PqfWViGsFL/czXNfZ/mVUond3cnxb vzeYSq8JhWmSITKlVd2Ia/RFn4n8imL73huhiAKUkLZ+IAzrrPRM7PyrQeSMEdMwtQZD OHQrJ6omSa2Nj2DTuFqktZrB09BQsBqHnYDuO9SDMjJpHXOji53en6RHqPerRDQNm3Ba BI2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gkhlZTuJ; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10si19950066pgk.395.2019.03.01.00.09.26; Fri, 01 Mar 2019 00:09:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gkhlZTuJ; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733066AbfCAIJY (ORCPT + 5 others); Fri, 1 Mar 2019 03:09:24 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:39374 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726195AbfCAIJV (ORCPT ); Fri, 1 Mar 2019 03:09:21 -0500 Received: by mail-lj1-f194.google.com with SMTP id g80so19576775ljg.6 for ; Fri, 01 Mar 2019 00:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SkqwhcXWOdlo5SWMFzsf8cAndUwOztl1pjPAoff5TV8=; b=gkhlZTuJ3qW6wo1Q3xyUlJifJjQKktdTTbhFx/NE8hX5Q6bxraPq/ErbtzysCgfQ1z p1K7rurtD/WDV0JCwd0MHbUZG3144nYPLeSzOW0DeKnD8y35FHawl+Vf6H7a32kqVTpl p2zOa5eNW13a7IEtgySXTubG8hCYPfH2vhlItDgAq5Yh3Qfn21vLoee4K887pFIyB7Ls 1YCzBv6FDKOnXI5a9F8QWFGJJLVjTSOD/pAOySOEE7CTLXLG5jxEBn0HQ1+Uj/BMcZkP b5JwNxChLiKDXNi+u3i3R1Gtzkvu9NtRMsIk4oOJSIlxb30L58pV7YAvma2PYz+jfIVR c8vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SkqwhcXWOdlo5SWMFzsf8cAndUwOztl1pjPAoff5TV8=; b=Lg2x/0ZhZ99vG8yKV8+XbVAR8mCFPDxHCOIH+cQDjYvqSBNvJewS219lZsI3HJ5NKq w7s1g/3khUUeniIbJA8jrE/CIxN7bcmt69Xa0IXHOcJK5rm3kYZErVVtBOonnRgkuovm enHBxTBI4NTaOWmJPD+ERyRyrvFqifVHj/yk9cVP8qvMq45Bms4aLQWRWOWeXRWoCdNF ybLr7C5TSlQxP04d/lnMaQWkUDxH570XUQmskfn+MpbuEi/C1hXzxhU0hDI88kaT0TDu OjR2Q3xCSiXk1cKq5wRIL5pB9KV7VPe+B5i8z0YTd5xSTAgwYAHQ/6FHQya6R3w65//9 ZOXQ== X-Gm-Message-State: APjAAAXC9APgmAfGiXTlNSigp3i9wOujlGwEHBO4Dhy0gESX2G5T2ZF8 yKlNTKf6uQ++bkHFli8mKUCXlyrCqPM= X-Received: by 2002:a2e:7a08:: with SMTP id v8mr1805292ljc.161.1551427759334; Fri, 01 Mar 2019 00:09:19 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id y20sm922617lfa.29.2019.03.01.00.09.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2019 00:09:16 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Bartosz Golaszewski , Linus Walleij , Enrico Weigelt Subject: [PATCH] gpio: amd-fch: Fix type error found by sparse Date: Fri, 1 Mar 2019 09:09:14 +0100 Message-Id: <20190301080914.19059-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Sparse complains: gpio-amd-fch.c:45:27: sparse: expected void * gpio-amd-fch.c:45:27: sparse: got void [noderef] * gpio-amd-fch.c:45:27: sparse: warning: incorrect type in return expression (different address spaces) gpio-amd-fch.c:56:9: sparse: expected void const volatile [noderef] *addr gpio-amd-fch.c:56:9: sparse: expected void volatile [noderef] *addr gpio-amd-fch.c:56:9: sparse: got void *ptr gpio-amd-fch.c:56:9: sparse: warning: incorrect type in argument 1 (different address spaces) I think it is because void * is returned rather than void __iomem *, so fix it up. Cc: Enrico Weigelt Signed-off-by: Linus Walleij --- drivers/gpio/gpio-amd-fch.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.20.1 diff --git a/drivers/gpio/gpio-amd-fch.c b/drivers/gpio/gpio-amd-fch.c index 4fd66444ea33..4c585d4e7e74 100644 --- a/drivers/gpio/gpio-amd-fch.c +++ b/drivers/gpio/gpio-amd-fch.c @@ -39,8 +39,8 @@ struct amd_fch_gpio_priv { spinlock_t lock; }; -static void *amd_fch_gpio_addr(struct amd_fch_gpio_priv *priv, - unsigned int gpio) +static void __iomem *amd_fch_gpio_addr(struct amd_fch_gpio_priv *priv, + unsigned int gpio) { return priv->base + priv->pdata->gpio_reg[gpio]*sizeof(u32); } @@ -50,7 +50,7 @@ static int amd_fch_gpio_direction_input(struct gpio_chip *gc, { unsigned long flags; struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc); - void *ptr = amd_fch_gpio_addr(priv, offset); + void __iomem *ptr = amd_fch_gpio_addr(priv, offset); spin_lock_irqsave(&priv->lock, flags); writel_relaxed(readl_relaxed(ptr) & ~AMD_FCH_GPIO_FLAG_DIRECTION, ptr); @@ -64,7 +64,7 @@ static int amd_fch_gpio_direction_output(struct gpio_chip *gc, { unsigned long flags; struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc); - void *ptr = amd_fch_gpio_addr(priv, gpio); + void __iomem *ptr = amd_fch_gpio_addr(priv, gpio); spin_lock_irqsave(&priv->lock, flags); writel_relaxed(readl_relaxed(ptr) | AMD_FCH_GPIO_FLAG_DIRECTION, ptr); @@ -78,7 +78,7 @@ static int amd_fch_gpio_get_direction(struct gpio_chip *gc, unsigned int gpio) int ret; unsigned long flags; struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc); - void *ptr = amd_fch_gpio_addr(priv, gpio); + void __iomem *ptr = amd_fch_gpio_addr(priv, gpio); spin_lock_irqsave(&priv->lock, flags); ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_DIRECTION); @@ -92,7 +92,7 @@ static void amd_fch_gpio_set(struct gpio_chip *gc, { unsigned long flags; struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc); - void *ptr = amd_fch_gpio_addr(priv, gpio); + void __iomem *ptr = amd_fch_gpio_addr(priv, gpio); u32 mask; spin_lock_irqsave(&priv->lock, flags); @@ -113,7 +113,7 @@ static int amd_fch_gpio_get(struct gpio_chip *gc, unsigned long flags; int ret; struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc); - void *ptr = amd_fch_gpio_addr(priv, offset); + void __iomem *ptr = amd_fch_gpio_addr(priv, offset); spin_lock_irqsave(&priv->lock, flags); ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_READ);