[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdXhVNGsEsUbmzYiFJcDN2uR5WFEFT5qdHdo0pF=0BGphA@mail.gmail.com>
Date: Mon, 24 Jun 2019 09:59:11 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Sam Ravnborg <sam@...nborg.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux-sh list <linux-sh@...r.kernel.org>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Rich Felker <dalias@...c.org>,
Will Deacon <will.deacon@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Mark Brown <broonie@...nel.org>,
Inki Dae <inki.dae@...sung.com>,
Krzysztof Kozlowski <krzk@...nel.org>
Subject: Re: [PATCH] sh: prevent warnings when using iounmap
Hi Sam,
On Sat, Jun 22, 2019 at 1:45 PM Sam Ravnborg <sam@...nborg.org> wrote:
> When building drm/exynos for sh, as part of an allmodconfig build,
> the following warning triggered:
>
> exynos7_drm_decon.c: In function ‘decon_remove’:
> exynos7_drm_decon.c:769:24: warning: unused variable ‘ctx’
> struct decon_context *ctx = dev_get_drvdata(&pdev->dev);
>
> The ctx variable is only used as argument to iounmap().
>
> In sh - allmodconfig CONFIG_MMU is not defined
> so it ended up in:
>
> \#define __iounmap(addr) do { } while (0)
> \#define iounmap __iounmap
>
> Fix the warning by introducing a static inline
> function for iounmap.
> This is similar to several other architectures.
>
> Signed-off-by: Sam Ravnborg <sam@...nborg.org>
Thanks for your patch!
> --- a/arch/sh/include/asm/io.h
> +++ b/arch/sh/include/asm/io.h
> @@ -369,7 +369,11 @@ static inline int iounmap_fixed(void __iomem *addr) { return -EINVAL; }
>
> #define ioremap_nocache ioremap
> #define ioremap_uc ioremap
> -#define iounmap __iounmap
> +
> +static inline void iounmap(void __iomem *addr)
> +{
> + __iounmap(addr);
> +}
The alternative would be to make __iounmap() static inline, which may be
better from the viewpoint of consistency within this header file.
Regardless:
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists