Re: [PATCH v3 05/13] sh: Fix set but not used warnings with !CONFIG_MMU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit aa1f4345b5480502a4e61addf5c59d606fdbce8f
Author: Sam Ravnborg <sam@xxxxxxxxxxxx>
Date:   Mon Nov 30 22:09:29 2020 +0100

    sh: Fix set but not used warnings with !CONFIG_MMU
    
    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@xxxxxxxxxxxx>
    Cc: kernel test robot <lkp@xxxxxxxxx>
    Cc: Thomas Zimmermann <tzimmermann@xxxxxxx>
    Cc: Lee Jones <lee.jones@xxxxxxxxxx>
    Cc: Rich Felker <dalias@xxxxxxxx>
    Cc: Arnd Bergmann <arnd@xxxxxxxx>
    Cc: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
    Cc: Mike Rapoport <rppt@xxxxxxxxxx>
    Cc: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
    Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
    Cc: Sam Ravnborg <sam@xxxxxxxxxxxx>
    Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

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 */
 
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux