• Thomas Bogendoerfer's avatar
    MIPS: Fix build warning about "PTR_STR" redefinition · b3878a6a
    Thomas Bogendoerfer authored
    PTR_STR is redefined when CONFIG_TEST_PRINTF is set. This causes the
    following build warning:
    
      CC      lib/test_printf.o
    lib/test_printf.c:214:0: warning: "PTR_STR" redefined
     #define PTR_STR "ffff0123456789ab"
     ^
    In file included from ./arch/mips/include/asm/dsemul.h:11:0,
                     from ./arch/mips/include/asm/processor.h:22,
                     from ./arch/mips/include/asm/thread_info.h:16,
                     from ./include/linux/thread_info.h:38,
                     from ./include/asm-generic/preempt.h:5,
                     from ./arch/mips/include/generated/asm/preempt.h:1,
                     from ./include/linux/preempt.h:78,
                     from ./include/linux/spinlock.h:51,
                     from ./include/linux/seqlock.h:36,
                     from ./include/linux/time.h:6,
                     from ./include/linux/stat.h:19,
                     from ./include/linux/module.h:13,
                     from lib/test_printf.c:10:
    ./arch/mips/include/asm/inst.h:20:0: note: this is the location of the previous definition
     #define PTR_STR  ".dword"
     ^
    
    Instead of renaming PTR_STR we move the unaligned macros to a new file,
    which is only included inside MIPS code. This way we can safely include
    asm.h and can use STR(PTR) again.
    
    Fixes: e701656e ("MIPS: inst.h: Stop including asm.h to avoid various build failures")
    Cc: Maciej W. Rozycki" <macro@linux-mips.org>
    Reported-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
    Co-developed-by: default avatarHuacai Chen <chenhc@lemote.com>
    Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
    Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
    b3878a6a
unaligned-emul.h 26.1 KB