s390/mem_detect: provide single get_mem_detect_end
authorVasily Gorbik <gor@linux.ibm.com>
Mon, 19 Aug 2019 21:14:10 +0000 (23:14 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 26 Aug 2019 10:51:18 +0000 (12:51 +0200)
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>
arch/s390/boot/mem_detect.c
arch/s390/include/asm/mem_detect.h
arch/s390/mm/kasan_init.c

index 5d316fe40480446b9dd5f90fc0bb4f3bba6d3b55..62e7c13ce85c7e2d6e078c133ca15750dd13f0c7 100644 (file)
@@ -63,13 +63,6 @@ void add_mem_detect_block(u64 start, u64 end)
        mem_detect.count++;
 }
 
-static unsigned long get_mem_detect_end(void)
-{
-       if (mem_detect.count)
-               return __get_mem_detect_block_ptr(mem_detect.count - 1)->end;
-       return 0;
-}
-
 static int __diag260(unsigned long rx1, unsigned long rx2)
 {
        register unsigned long _rx1 asm("2") = rx1;
index 6114b92ab667b7f558447d6d0156304dc52ff311..a7c922a690509a22d279c42de7e2b8312152ec9d 100644 (file)
@@ -79,4 +79,16 @@ static inline void get_mem_detect_reserved(unsigned long *start,
                *size = 0;
 }
 
+static inline unsigned long get_mem_detect_end(void)
+{
+       unsigned long start;
+       unsigned long end;
+
+       if (mem_detect.count) {
+               __get_mem_detect_block(mem_detect.count - 1, &start, &end);
+               return end;
+       }
+       return 0;
+}
+
 #endif
index 0c1f257be422247b3e5835233582e07c80465e5c..4a61bc95538827f94d9de6f63de8f570e5b1d3d9 100644 (file)
@@ -236,18 +236,6 @@ static void __init kasan_early_detect_facilities(void)
        }
 }
 
-static unsigned long __init get_mem_detect_end(void)
-{
-       unsigned long start;
-       unsigned long end;
-
-       if (mem_detect.count) {
-               __get_mem_detect_block(mem_detect.count - 1, &start, &end);
-               return end;
-       }
-       return 0;
-}
-
 void __init kasan_early_init(void)
 {
        unsigned long untracked_mem_end;