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

ARC: uaccess: elide unaliged handling if hardware supports

Signed-off-by: Vineet Gupta <vgupta@kernel.org>

+6 -4
+6 -4
arch/arc/include/asm/uaccess.h
··· 146 146 if (n == 0) 147 147 return 0; 148 148 149 - /* unaligned */ 150 - if (((unsigned long)to & 0x3) || ((unsigned long)from & 0x3)) { 149 + /* fallback for unaligned access when hardware doesn't support */ 150 + if (!IS_ENABLED(CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS) && 151 + (((unsigned long)to & 0x3) || ((unsigned long)from & 0x3))) { 151 152 152 153 unsigned char tmp; 153 154 ··· 374 373 if (n == 0) 375 374 return 0; 376 375 377 - /* unaligned */ 378 - if (((unsigned long)to & 0x3) || ((unsigned long)from & 0x3)) { 376 + /* fallback for unaligned access when hardware doesn't support */ 377 + if (!IS_ENABLED(CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS) && 378 + (((unsigned long)to & 0x3) || ((unsigned long)from & 0x3))) { 379 379 380 380 unsigned char tmp; 381 381