Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[MIPS] Put cast inside macro instead of all the callers

Since all the callers of the PHYS_TO_XKPHYS macro call with a constant,
put the cast to LL inside the macro where it really should be rather
than in all the callers. This makes macros like PHYS_TO_XKSEG_UNCACHED
work without gcc whining.

Signed-off-by: Andrew Sharp <andy.sharp@onstor.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Andrew Sharp and committed by
Ralf Baechle
48ef2626 2206583d

+7 -7
+6 -6
arch/mips/lib/uncached.c
··· 46 46 if (sp >= (long)CKSEG0 && sp < (long)CKSEG2) 47 47 usp = CKSEG1ADDR(sp); 48 48 #ifdef CONFIG_64BIT 49 - else if ((long long)sp >= (long long)PHYS_TO_XKPHYS(0LL, 0) && 50 - (long long)sp < (long long)PHYS_TO_XKPHYS(8LL, 0)) 51 - usp = PHYS_TO_XKPHYS((long long)K_CALG_UNCACHED, 49 + else if ((long long)sp >= (long long)PHYS_TO_XKPHYS(0, 0) && 50 + (long long)sp < (long long)PHYS_TO_XKPHYS(8, 0)) 51 + usp = PHYS_TO_XKPHYS(K_CALG_UNCACHED, 52 52 XKPHYS_TO_PHYS((long long)sp)); 53 53 #endif 54 54 else { ··· 58 58 if (lfunc >= (long)CKSEG0 && lfunc < (long)CKSEG2) 59 59 ufunc = CKSEG1ADDR(lfunc); 60 60 #ifdef CONFIG_64BIT 61 - else if ((long long)lfunc >= (long long)PHYS_TO_XKPHYS(0LL, 0) && 62 - (long long)lfunc < (long long)PHYS_TO_XKPHYS(8LL, 0)) 63 - ufunc = PHYS_TO_XKPHYS((long long)K_CALG_UNCACHED, 61 + else if ((long long)lfunc >= (long long)PHYS_TO_XKPHYS(0, 0) && 62 + (long long)lfunc < (long long)PHYS_TO_XKPHYS(8, 0)) 63 + ufunc = PHYS_TO_XKPHYS(K_CALG_UNCACHED, 64 64 XKPHYS_TO_PHYS((long long)lfunc)); 65 65 #endif 66 66 else {
+1 -1
include/asm-mips/addrspace.h
··· 127 127 #define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE, (p)) 128 128 #define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK) 129 129 #define PHYS_TO_XKPHYS(cm, a) (_CONST64_(0x8000000000000000) | \ 130 - ((cm)<<59) | (a)) 130 + (_CONST64_(cm) << 59) | (a)) 131 131 132 132 /* 133 133 * The ultimate limited of the 64-bit MIPS architecture: 2 bits for selecting