Skip to content

Commit 17c51b1

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/mm: use BIT macro to generate SET_MEMORY bit masks
Use BIT macro to generate SET_MEMORY bit masks, which is easier to maintain if bits get added, or removed. Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 0ae241f commit 17c51b1

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

arch/s390/include/asm/set_memory.h

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@
66

77
extern struct mutex cpa_mutex;
88

9-
#define SET_MEMORY_RO 1UL
10-
#define SET_MEMORY_RW 2UL
11-
#define SET_MEMORY_NX 4UL
12-
#define SET_MEMORY_X 8UL
13-
#define SET_MEMORY_4K 16UL
9+
enum {
10+
_SET_MEMORY_RO_BIT,
11+
_SET_MEMORY_RW_BIT,
12+
_SET_MEMORY_NX_BIT,
13+
_SET_MEMORY_X_BIT,
14+
_SET_MEMORY_4K_BIT,
15+
};
16+
17+
#define SET_MEMORY_RO BIT(_SET_MEMORY_RO_BIT)
18+
#define SET_MEMORY_RW BIT(_SET_MEMORY_RW_BIT)
19+
#define SET_MEMORY_NX BIT(_SET_MEMORY_NX_BIT)
20+
#define SET_MEMORY_X BIT(_SET_MEMORY_X_BIT)
21+
#define SET_MEMORY_4K BIT(_SET_MEMORY_4K_BIT)
1422

1523
int __set_memory(unsigned long addr, int numpages, unsigned long flags);
1624

0 commit comments

Comments
 (0)