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

ARC: mm: use generic macros _BITUL()/_AC()

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

authored by

Alexey Brodkin and committed by
Vineet Gupta
d4084645 8840e14c

+8 -14
+4 -7
arch/arc/include/asm/pgtable.h
··· 38 38 #include <asm/page.h> 39 39 #include <asm/mmu.h> 40 40 #include <asm-generic/pgtable-nopmd.h> 41 + #include <linux/const.h> 41 42 42 43 /************************************************************************** 43 44 * Page Table Flags ··· 208 207 #define PGDIR_SIZE (1UL << PGDIR_SHIFT) /* vaddr span, not PDG sz */ 209 208 #define PGDIR_MASK (~(PGDIR_SIZE-1)) 210 209 211 - #ifdef __ASSEMBLY__ 212 - #define PTRS_PER_PTE (1 << BITS_FOR_PTE) 213 - #define PTRS_PER_PGD (1 << BITS_FOR_PGD) 214 - #else 215 - #define PTRS_PER_PTE (1UL << BITS_FOR_PTE) 216 - #define PTRS_PER_PGD (1UL << BITS_FOR_PGD) 217 - #endif 210 + #define PTRS_PER_PTE _BITUL(BITS_FOR_PTE) 211 + #define PTRS_PER_PGD _BITUL(BITS_FOR_PGD) 212 + 218 213 /* 219 214 * Number of entries a user land program use. 220 215 * TASK_SIZE is the maximum vaddr that can be used by a userland program.
+4 -7
arch/arc/include/uapi/asm/page.h
··· 9 9 #ifndef _UAPI__ASM_ARC_PAGE_H 10 10 #define _UAPI__ASM_ARC_PAGE_H 11 11 12 + #include <linux/const.h> 13 + 12 14 /* PAGE_SHIFT determines the page size */ 13 15 #if defined(CONFIG_ARC_PAGE_SIZE_16K) 14 16 #define PAGE_SHIFT 14 ··· 27 25 #define PAGE_SHIFT 13 28 26 #endif 29 27 30 - #ifdef __ASSEMBLY__ 31 - #define PAGE_SIZE (1 << PAGE_SHIFT) 32 - #define PAGE_OFFSET (0x80000000) 33 - #else 34 - #define PAGE_SIZE (1UL << PAGE_SHIFT) /* Default 8K */ 35 - #define PAGE_OFFSET (0x80000000UL) /* Kernel starts at 2G onwards */ 36 - #endif 28 + #define PAGE_SIZE _BITUL(PAGE_SHIFT) /* Default 8K */ 29 + #define PAGE_OFFSET _AC(0x80000000, UL) /* Kernel starts at 2G onwrds */ 37 30 38 31 #define PAGE_MASK (~(PAGE_SIZE-1)) 39 32