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

MIPS: Define __arch_swab64 for all mips r2 cpus

Some CPUs implement mipsr2, but because they are a super-set of mips64r2 do
not define CONFIG_CPU_MIPS64_R2. Cavium OCTEON falls into this category.
We would still like to use the optimized implementation, so since we have
already checked for CONFIG_CPU_MIPSR2, checking for CONFIG_64BIT instead of
CONFIG_CPU_MIPS64_R2 is sufficient.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

David Daney and committed by
Ralf Baechle
b53d4d1f 27fdd325

+6 -2
+6 -2
arch/mips/include/asm/swab.h
··· 38 38 } 39 39 #define __arch_swab32 __arch_swab32 40 40 41 - #ifdef CONFIG_CPU_MIPS64_R2 41 + /* 42 + * Having already checked for CONFIG_CPU_MIPSR2, enable the 43 + * optimized version for 64-bit kernel on r2 CPUs. 44 + */ 45 + #ifdef CONFIG_64BIT 42 46 static inline __attribute_const__ __u64 __arch_swab64(__u64 x) 43 47 { 44 48 __asm__( ··· 54 50 return x; 55 51 } 56 52 #define __arch_swab64 __arch_swab64 57 - #endif /* CONFIG_CPU_MIPS64_R2 */ 53 + #endif /* CONFIG_64BIT */ 58 54 #endif /* CONFIG_CPU_MIPSR2 */ 59 55 #endif /* _ASM_SWAB_H */