summaryrefslogtreecommitdiffstats
path: root/arch/s390/include
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2023-04-14 14:30:43 +0200
committerVasily Gorbik <gor@linux.ibm.com>2023-04-20 11:36:29 +0200
commit17c51b1ba9c2d4b497349ac1622aafe67be16103 (patch)
tree1d66fc120c57a27eebee7de3d101515e8c59d627 /arch/s390/include
parent0ae241f4d7d0003f091df6f8d1f45767c3d96d62 (diff)
downloadlinux-stable-17c51b1ba9c2d4b497349ac1622aafe67be16103.tar.gz
linux-stable-17c51b1ba9c2d4b497349ac1622aafe67be16103.tar.bz2
linux-stable-17c51b1ba9c2d4b497349ac1622aafe67be16103.zip
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>
Diffstat (limited to 'arch/s390/include')
-rw-r--r--arch/s390/include/asm/set_memory.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/s390/include/asm/set_memory.h b/arch/s390/include/asm/set_memory.h
index 25f2464dbb7e..ec3f44c602eb 100644
--- a/arch/s390/include/asm/set_memory.h
+++ b/arch/s390/include/asm/set_memory.h
@@ -6,11 +6,19 @@
extern struct mutex cpa_mutex;
-#define SET_MEMORY_RO 1UL
-#define SET_MEMORY_RW 2UL
-#define SET_MEMORY_NX 4UL
-#define SET_MEMORY_X 8UL
-#define SET_MEMORY_4K 16UL
+enum {
+ _SET_MEMORY_RO_BIT,
+ _SET_MEMORY_RW_BIT,
+ _SET_MEMORY_NX_BIT,
+ _SET_MEMORY_X_BIT,
+ _SET_MEMORY_4K_BIT,
+};
+
+#define SET_MEMORY_RO BIT(_SET_MEMORY_RO_BIT)
+#define SET_MEMORY_RW BIT(_SET_MEMORY_RW_BIT)
+#define SET_MEMORY_NX BIT(_SET_MEMORY_NX_BIT)
+#define SET_MEMORY_X BIT(_SET_MEMORY_X_BIT)
+#define SET_MEMORY_4K BIT(_SET_MEMORY_4K_BIT)
int __set_memory(unsigned long addr, int numpages, unsigned long flags);