All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/1] sh: W=1 warning fixes in fbdev
@ 2020-12-08 18:21 Sam Ravnborg
  2020-12-08 18:21 ` [PATCH] sh: Fix set but not used warnings with !CONFIG_MMU Sam Ravnborg
  0 siblings, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2020-12-08 18:21 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, linux-sh
  Cc: kernel test robot, Thomas Zimmermann, Lee Jones, Arnd Bergmann,
	Geert Uytterhoeven, Mike Rapoport, Kuninori Morimoto,
	Peter Zijlstra, Sam Ravnborg, Andrew Morton

In certain configurations the current definition of iounmap()
caused set-but-not-used warnings.

This is fixed by casting the input parameter with (void).

The sole patch included here was a part of a larger video/fbdev/
set of patches.  This explains the "v4" tag.

Yoshinori san and Rich - please apply to the sh tree.

	Sam

Sam Ravnborg (1):
      sh: Fix set but not used warnings with !CONFIG_MMU

 arch/sh/include/asm/io.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] sh: Fix set but not used warnings with !CONFIG_MMU
  2020-12-08 18:21 [PATCH v4 0/1] sh: W=1 warning fixes in fbdev Sam Ravnborg
@ 2020-12-08 18:21 ` Sam Ravnborg
  2020-12-08 18:52   ` Thomas Zimmermann
  0 siblings, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2020-12-08 18:21 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, linux-sh
  Cc: kernel test robot, Thomas Zimmermann, Lee Jones, Arnd Bergmann,
	Geert Uytterhoeven, Mike Rapoport, Kuninori Morimoto,
	Peter Zijlstra, Sam Ravnborg, Andrew Morton

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.

v4:
  - Fix build error of ethernet driver (kernel test robot)
    Added missing () around macro parameter

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: kernel test robot <lkp@intel.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Rich Felker <dalias@libc.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 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..45082bcbd9aa 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 */
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sh: Fix set but not used warnings with !CONFIG_MMU
  2020-12-08 18:21 ` [PATCH] sh: Fix set but not used warnings with !CONFIG_MMU Sam Ravnborg
@ 2020-12-08 18:52   ` Thomas Zimmermann
  2020-12-08 19:00     ` Sam Ravnborg
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Zimmermann @ 2020-12-08 18:52 UTC (permalink / raw)
  To: Sam Ravnborg, Yoshinori Sato, Rich Felker, linux-sh
  Cc: kernel test robot, Lee Jones, Arnd Bergmann, Geert Uytterhoeven,
	Mike Rapoport, Kuninori Morimoto, Peter Zijlstra, Andrew Morton


[-- Attachment #1.1: Type: text/plain, Size: 2073 bytes --]



Am 08.12.20 um 19:21 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.
> 
> v4:
>    - Fix build error of ethernet driver (kernel test robot)
>      Added missing () around macro parameter
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: kernel test robot <lkp@intel.com>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Rich Felker <dalias@libc.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Mike Rapoport <rppt@kernel.org>
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>

Acked-by: Thomas Zimmermann <tzimmermann@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..45082bcbd9aa 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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sh: Fix set but not used warnings with !CONFIG_MMU
  2020-12-08 18:52   ` Thomas Zimmermann
@ 2020-12-08 19:00     ` Sam Ravnborg
  0 siblings, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2020-12-08 19:00 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: Yoshinori Sato, Rich Felker, linux-sh, kernel test robot,
	Lee Jones, Arnd Bergmann, Geert Uytterhoeven, Mike Rapoport,
	Kuninori Morimoto, Peter Zijlstra, Andrew Morton

Hi Thomas.

On Tue, Dec 08, 2020 at 07:52:49PM +0100, Thomas Zimmermann wrote:
> 
> 
> Am 08.12.20 um 19:21 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.
> > 
> > v4:
> >    - Fix build error of ethernet driver (kernel test robot)
> >      Added missing () around macro parameter
> > 
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > Cc: kernel test robot <lkp@intel.com>
> > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > Cc: Lee Jones <lee.jones@linaro.org>
> > Cc: Rich Felker <dalias@libc.org>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> > Cc: Mike Rapoport <rppt@kernel.org>
> > Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> 
> Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

The ack is added in my commit, but I forgot to refresh the patch :-(
Thanks for noticing.

	Sam


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-08 20:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 18:21 [PATCH v4 0/1] sh: W=1 warning fixes in fbdev Sam Ravnborg
2020-12-08 18:21 ` [PATCH] sh: Fix set but not used warnings with !CONFIG_MMU Sam Ravnborg
2020-12-08 18:52   ` Thomas Zimmermann
2020-12-08 19:00     ` Sam Ravnborg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.