diff options
author | Vineet Gupta <vgupta@kernel.org> | 2020-02-03 20:43:22 +0100 |
---|---|---|
committer | Vineet Gupta <vgupta@kernel.org> | 2023-08-17 21:40:26 +0200 |
commit | c8ee610afe654da7276d4aa8ad2bb60ffff6ddfc (patch) | |
tree | c53f1bf601440d02489e9717328a8020da815472 /arch/arc | |
parent | ARC: uaccess: use optimized generic __strnlen_user/__strncpy_from_user (diff) | |
download | linux-c8ee610afe654da7276d4aa8ad2bb60ffff6ddfc.tar.xz linux-c8ee610afe654da7276d4aa8ad2bb60ffff6ddfc.zip |
ARC: uaccess: elide unaliged handling if hardware supports
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
Diffstat (limited to 'arch/arc')
-rw-r--r-- | arch/arc/include/asm/uaccess.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arc/include/asm/uaccess.h b/arch/arc/include/asm/uaccess.h index d2da159bb80a..1e8809ea000a 100644 --- a/arch/arc/include/asm/uaccess.h +++ b/arch/arc/include/asm/uaccess.h @@ -146,8 +146,9 @@ raw_copy_from_user(void *to, const void __user *from, unsigned long n) if (n == 0) return 0; - /* unaligned */ - if (((unsigned long)to & 0x3) || ((unsigned long)from & 0x3)) { + /* fallback for unaligned access when hardware doesn't support */ + if (!IS_ENABLED(CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS) && + (((unsigned long)to & 0x3) || ((unsigned long)from & 0x3))) { unsigned char tmp; @@ -373,8 +374,9 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n) if (n == 0) return 0; - /* unaligned */ - if (((unsigned long)to & 0x3) || ((unsigned long)from & 0x3)) { + /* fallback for unaligned access when hardware doesn't support */ + if (!IS_ENABLED(CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS) && + (((unsigned long)to & 0x3) || ((unsigned long)from & 0x3))) { unsigned char tmp; |