[PATCH v3 05/13] sh: Fix set but not used warnings with !CONFIG_MMU
Thomas Zimmermann
tzimmermann at suse.de
Mon Dec 7 03:19:56 EST 2020
Am 06.12.20 um 20:02 schrieb Sam Ravnborg:
> Building fbdev drivers for sh with W=1 produces the following warning:
>
> tmiofb.c: In function ‘tmiofb_remove’:
> tmiofb.c:805:21: warning: variable ‘par’ set but not used
>
> This is with allmodconfig and ARCH=sh
>
> This boiled down to iounmap() defined as empty for !CONFIG_MMU.
> Fix this by by adding "(void)addr;" to tell the compiler the
> argument to iounmap() should be considered used.
>
> Signed-off-by: Sam Ravnborg <sam at ravnborg.org>
> Cc: Thomas Zimmermann <tzimmermann at suse.de>
> Cc: Lee Jones <lee.jones at linaro.org>
> Cc: Rich Felker <dalias at libc.org>
> Cc: Arnd Bergmann <arnd at arndb.de>
> Cc: Geert Uytterhoeven <geert+renesas at glider.be>
> Cc: Mike Rapoport <rppt at kernel.org>
> Cc: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
> Cc: Peter Zijlstra <peterz at infradead.org>
> Cc: Sam Ravnborg <sam at ravnborg.org>
> Cc: Andrew Morton <akpm at linux-foundation.org>
Acked-by: Thomas Zimmermann <tzimmermann at suse.de>
> ---
> arch/sh/include/asm/io.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
> index 6d5c6463bc07..5ad56c6c1e1e 100644
> --- a/arch/sh/include/asm/io.h
> +++ b/arch/sh/include/asm/io.h
> @@ -271,7 +271,7 @@ 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 iounmap(addr) do { (void)addr; } while (0)
> #define ioremap(offset, size) ((void __iomem *)(unsigned long)(offset))
> #endif /* CONFIG_MMU */
>
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20201207/c055d90d/attachment.sig>
More information about the linux-arm-kernel
mailing list