mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>,
	Rich Felker <dalias@libc.org>, Christoph Hellwig <hch@lst.de>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	kernel test robot <lkp@intel.com>,
	"Arnd Bergmann" <arnd@arndb.de>, <linux-sh@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sh: Convert nommu io{re,un}map() to static inline functions
Date: Tue, 15 Feb 2022 12:03:19 +0000	[thread overview]
Message-ID: <20220215120319.00004feb@Huawei.com> (raw)
In-Reply-To: <4ed0a7a0d3fa912a5b44c451884818f2c138ef42.1644914600.git.geert+renesas@glider.be>

On Tue, 15 Feb 2022 09:51:05 +0100
Geert Uytterhoeven <geert+renesas@glider.be> wrote:

> Recently, nommu iounmap() was converted from a static inline function to
> a macro again, basically reverting commit 4580ba4ad2e6b8dd ("sh: Convert
> iounmap() macros to inline functions").  With -Werror, this leads to
> build failures like:
> 
>     drivers/iio/adc/xilinx-ams.c: In function ‘ams_iounmap_ps’:
>     drivers/iio/adc/xilinx-ams.c:1195:14: error: unused variable ‘ams’ [-Werror=unused-variable]
>      1195 |  struct ams *ams = data;
> 	  |              ^~~
> 
> Fix this by replacing the macros for ioremap() and iounmap() by static
> inline functions, based on <asm-generic/io.h>.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Fixes: 13f1fc870dd74713 ("sh: move the ioremap implementation out of line")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Looks good.

Thanks for the quick response.

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
> This is actually the third time this change was made, as Christoph
> converted iounmap() to a macro before in commit 98c90e5ea34e98bd ("sh:
> remove __iounmap"), reverting commit 733f0025f0fb43e3 ("sh: prevent
> warnings when using iounmap").
> 
> Probably sh-nommu should include <asm-generic/io.h>, but that would
> require a lot more changes.
> ---
>  arch/sh/include/asm/io.h | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
> index cf9a3ec32406f856..fba90e670ed41d48 100644
> --- a/arch/sh/include/asm/io.h
> +++ b/arch/sh/include/asm/io.h
> @@ -271,8 +271,12 @@ static inline void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size,
>  #endif /* CONFIG_HAVE_IOREMAP_PROT */
>  
>  #else /* CONFIG_MMU */
> -#define iounmap(addr)		do { } while (0)
> -#define ioremap(offset, size)	((void __iomem *)(unsigned long)(offset))
> +static inline void __iomem *ioremap(phys_addr_t offset, size_t size)
> +{
> +	return (void __iomem *)(unsigned long)offset;
> +}
> +
> +static inline void iounmap(volatile void __iomem *addr) { }
>  #endif /* CONFIG_MMU */
>  
>  #define ioremap_uc	ioremap


  reply	other threads:[~2022-02-15 12:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15  8:51 Geert Uytterhoeven
2022-02-15 12:03 ` Jonathan Cameron [this message]
2022-02-15 19:16 ` Christoph Hellwig

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=20220215120319.00004feb@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=arnd@arndb.de \
    --cc=dalias@libc.org \
    --cc=geert+renesas@glider.be \
    --cc=hch@lst.de \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=ysato@users.sourceforge.jp \
    /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

all inboxes | Powered by JetHome®