Skip to content
  • Arnd Bergmann's avatar
    mm: fix nodemask printing · 1334be36
    Arnd Bergmann authored
    The cleanup caused build warnings for constant mask pointers:
    
      mm/mempolicy.c: In function `mpol_to_str':
      ./include/linux/nodemask.h:108:11: warning: the comparison will always evaluate as `true' for the address of `nodes' will never be NULL [-Waddress]
    
    An earlier workaround I suggested was incorporated in the version that
    got merged, but that only solved the problem for gcc-7 and higher, while
    gcc-4.6 through gcc-6.x still warn.
    
    This changes the printing again to use inline functions that make it
    clear to the compiler that the line that does the NULL check has no idea
    whether the argument is a constant NULL.
    
    Link: http://lkml.kernel.org/r/20171117101545.119689-1-arnd@arndb.de
    Fixes: 0205f755
    
     ("mm: simplify nodemask printing")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Cc: Michal Hocko <mhocko@kernel.org>
    Cc: Stephen Rothwell <sfr@canb.auug.org.au>
    Cc: Zhangshaokun <zhangshaokun@hisilicon.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    1334be36