• Mike Rapoport's avatar
    asm-generic/nds32: don't redefine cacheflush primitives · 4f0bd808
    Mike Rapoport authored
    The commit c296d4dc ("asm-generic: fix a compilation warning") changed
    asm-generic/cachflush.h to use static inlines instead of macros and as a
    result the nds32 build with CONFIG_CPU_CACHE_ALIASING=n fails:
    
      CC      init/main.o
    In file included from arch/nds32/include/asm/cacheflush.h:43,
                     from include/linux/highmem.h:12,
                     from include/linux/pagemap.h:11,
                     from include/linux/blkdev.h:16,
                     from include/linux/blk-cgroup.h:23,
                     from include/linux/writeback.h:14,
                     from init/main.c:44:
    include/asm-generic/cacheflush.h:50:20: error: static declaration of 'flush_icache_range' follows non-static declaration
     static inline void flush_icache_range(unsigned long start, unsigned long end)
                        ^~~~~~~~~~~~~~~~~~
    In file included from include/linux/highmem.h:12,
                     from include/linux/pagemap.h:11,
                     from include/linux/blkdev.h:16,
                     from include/linux/blk-cgroup.h:23,
                     from include/linux/writeback.h:14,
                     from init/main.c:44:
    arch/nds32/include/asm/cacheflush.h:11:6: note: previous declaration of 'flush_icache_range' was here
     void flush_icache_range(unsigned long start, unsigned long end);
          ^~~~~~~~~~~~~~~~~~
    
    Surround the inline functions in asm-generic/cacheflush.h by ifdef's so
    that architectures could override them and add the required overrides to
    nds32.
    
    Fixes: c296d4dc ("asm-generic: fix a compilation warning")
    Link: https://lore.kernel.org/lkml/201912212139.yptX8CsV%25lkp@intel.com/Reported-by: default avatarkbuild test robot <lkp@intel.com>
    Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
    Reviewed-by: default avatarGreentime Hu <green.hu@gmail.com>
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    4f0bd808
cacheflush.h 2.21 KB