diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2019-08-19 17:14:10 -0400 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2019-08-26 06:51:18 -0400 |
commit | 9b692102d87d13d24c97461207cae259121ed44b (patch) | |
tree | 5c7f45a3f1e1548efcfb125c3d6127ee9aa7f484 | |
parent | 5f0917a281c66fb310988d4c38f3c55b7023b8ff (diff) |
s390/mem_detect: provide single get_mem_detect_end
get_mem_detect_end is already used in couple of places with potential
to be utilized in more cases. Provide single get_mem_detect_end
implementation in asm/mem_detect.h to be used by kasan and startup code.
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-rw-r--r-- | arch/s390/boot/mem_detect.c | 7 | ||||
-rw-r--r-- | arch/s390/include/asm/mem_detect.h | 12 | ||||
-rw-r--r-- | arch/s390/mm/kasan_init.c | 12 |
3 files changed, 12 insertions, 19 deletions
diff --git a/arch/s390/boot/mem_detect.c b/arch/s390/boot/mem_detect.c index 5d316fe40480..62e7c13ce85c 100644 --- a/arch/s390/boot/mem_detect.c +++ b/arch/s390/boot/mem_detect.c | |||
@@ -63,13 +63,6 @@ void add_mem_detect_block(u64 start, u64 end) | |||
63 | mem_detect.count++; | 63 | mem_detect.count++; |
64 | } | 64 | } |
65 | 65 | ||
66 | static unsigned long get_mem_detect_end(void) | ||
67 | { | ||
68 | if (mem_detect.count) | ||
69 | return __get_mem_detect_block_ptr(mem_detect.count - 1)->end; | ||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | static int __diag260(unsigned long rx1, unsigned long rx2) | 66 | static int __diag260(unsigned long rx1, unsigned long rx2) |
74 | { | 67 | { |
75 | register unsigned long _rx1 asm("2") = rx1; | 68 | register unsigned long _rx1 asm("2") = rx1; |
diff --git a/arch/s390/include/asm/mem_detect.h b/arch/s390/include/asm/mem_detect.h index 6114b92ab667..a7c922a69050 100644 --- a/arch/s390/include/asm/mem_detect.h +++ b/arch/s390/include/asm/mem_detect.h | |||
@@ -79,4 +79,16 @@ static inline void get_mem_detect_reserved(unsigned long *start, | |||
79 | *size = 0; | 79 | *size = 0; |
80 | } | 80 | } |
81 | 81 | ||
82 | static inline unsigned long get_mem_detect_end(void) | ||
83 | { | ||
84 | unsigned long start; | ||
85 | unsigned long end; | ||
86 | |||
87 | if (mem_detect.count) { | ||
88 | __get_mem_detect_block(mem_detect.count - 1, &start, &end); | ||
89 | return end; | ||
90 | } | ||
91 | return 0; | ||
92 | } | ||
93 | |||
82 | #endif | 94 | #endif |
diff --git a/arch/s390/mm/kasan_init.c b/arch/s390/mm/kasan_init.c index 0c1f257be422..4a61bc955388 100644 --- a/arch/s390/mm/kasan_init.c +++ b/arch/s390/mm/kasan_init.c | |||
@@ -236,18 +236,6 @@ static void __init kasan_early_detect_facilities(void) | |||
236 | } | 236 | } |
237 | } | 237 | } |
238 | 238 | ||
239 | static unsigned long __init get_mem_detect_end(void) | ||
240 | { | ||
241 | unsigned long start; | ||
242 | unsigned long end; | ||
243 | |||
244 | if (mem_detect.count) { | ||
245 | __get_mem_detect_block(mem_detect.count - 1, &start, &end); | ||
246 | return end; | ||
247 | } | ||
248 | return 0; | ||
249 | } | ||
250 | |||
251 | void __init kasan_early_init(void) | 239 | void __init kasan_early_init(void) |
252 | { | 240 | { |
253 | unsigned long untracked_mem_end; | 241 | unsigned long untracked_mem_end; |