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

Configure Feed

Select the types of activity you want to include in your feed.

ARM: provide individual is_translation_fault() and is_permission_fault()

Provide individual LPAE and non-LPAE definitions for both these
functions, rather than having ifdefs inside the function body. This
places the functions closer to their associated definitions.

Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

+19 -17
+19 -17
arch/arm/mm/fault.h
··· 21 21 { 22 22 return fsr & FSR_FS5_0; 23 23 } 24 + 25 + static inline bool is_translation_fault(unsigned int fsr) 26 + { 27 + int fs = fsr_fs(fsr); 28 + 29 + return (fs & FS_MMU_NOLL_MASK) == FS_TRANS_NOLL; 30 + } 31 + 32 + static inline bool is_permission_fault(unsigned int fsr) 33 + { 34 + int fs = fsr_fs(fsr); 35 + 36 + return (fs & FS_MMU_NOLL_MASK) == FS_PERM_NOLL; 37 + } 24 38 #else 25 39 #define FSR_FS_AEA 22 26 40 #define FS_L1_TRANS 0x5 ··· 49 35 { 50 36 return (fsr & FSR_FS3_0) | (fsr & FSR_FS4) >> 6; 51 37 } 52 - #endif 53 38 54 39 static inline bool is_translation_fault(unsigned int fsr) 55 40 { 56 41 int fs = fsr_fs(fsr); 57 - #ifdef CONFIG_ARM_LPAE 58 - if ((fs & FS_MMU_NOLL_MASK) == FS_TRANS_NOLL) 59 - return true; 60 - #else 61 - if (fs == FS_L1_TRANS || fs == FS_L2_TRANS) 62 - return true; 63 - #endif 64 - return false; 42 + 43 + return fs == FS_L1_TRANS || fs == FS_L2_TRANS; 65 44 } 66 45 67 46 static inline bool is_permission_fault(unsigned int fsr) 68 47 { 69 48 int fs = fsr_fs(fsr); 70 - #ifdef CONFIG_ARM_LPAE 71 - if ((fs & FS_MMU_NOLL_MASK) == FS_PERM_NOLL) 72 - return true; 73 - #else 74 - if (fs == FS_L1_PERM || fs == FS_L2_PERM) 75 - return true; 76 - #endif 77 - return false; 49 + 50 + return fs == FS_L1_PERM || fs == FS_L2_PERM; 78 51 } 52 + #endif 79 53 80 54 void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs); 81 55 void early_abt_enable(void);