Skip to content

Commit d408464

Browse files
abrodkinvineetgarc
authored andcommitted
ARC: mm: use generic macros _BITUL()/_AC()
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
1 parent 8840e14 commit d408464

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

arch/arc/include/asm/pgtable.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <asm/page.h>
3939
#include <asm/mmu.h>
4040
#include <asm-generic/pgtable-nopmd.h>
41+
#include <linux/const.h>
4142

4243
/**************************************************************************
4344
* Page Table Flags
@@ -207,13 +208,9 @@
207208
#define PGDIR_SIZE (1UL << PGDIR_SHIFT) /* vaddr span, not PDG sz */
208209
#define PGDIR_MASK (~(PGDIR_SIZE-1))
209210

210-
#ifdef __ASSEMBLY__
211-
#define PTRS_PER_PTE (1 << BITS_FOR_PTE)
212-
#define PTRS_PER_PGD (1 << BITS_FOR_PGD)
213-
#else
214-
#define PTRS_PER_PTE (1UL << BITS_FOR_PTE)
215-
#define PTRS_PER_PGD (1UL << BITS_FOR_PGD)
216-
#endif
211+
#define PTRS_PER_PTE _BITUL(BITS_FOR_PTE)
212+
#define PTRS_PER_PGD _BITUL(BITS_FOR_PGD)
213+
217214
/*
218215
* Number of entries a user land program use.
219216
* TASK_SIZE is the maximum vaddr that can be used by a userland program.

arch/arc/include/uapi/asm/page.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#ifndef _UAPI__ASM_ARC_PAGE_H
1010
#define _UAPI__ASM_ARC_PAGE_H
1111

12+
#include <linux/const.h>
13+
1214
/* PAGE_SHIFT determines the page size */
1315
#if defined(CONFIG_ARC_PAGE_SIZE_16K)
1416
#define PAGE_SHIFT 14
@@ -25,13 +27,8 @@
2527
#define PAGE_SHIFT 13
2628
#endif
2729

28-
#ifdef __ASSEMBLY__
29-
#define PAGE_SIZE (1 << PAGE_SHIFT)
30-
#define PAGE_OFFSET (0x80000000)
31-
#else
32-
#define PAGE_SIZE (1UL << PAGE_SHIFT) /* Default 8K */
33-
#define PAGE_OFFSET (0x80000000UL) /* Kernel starts at 2G onwards */
34-
#endif
30+
#define PAGE_SIZE _BITUL(PAGE_SHIFT) /* Default 8K */
31+
#define PAGE_OFFSET _AC(0x80000000, UL) /* Kernel starts at 2G onwrds */
3532

3633
#define PAGE_MASK (~(PAGE_SIZE-1))
3734

0 commit comments

Comments
 (0)