Skip to content

Commit

Permalink
s390/mem_detect: provide single get_mem_detect_end
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vasily Gorbik committed Aug 26, 2019
1 parent 5f0917a commit 9b69210
Showing 3 changed files with 12 additions and 19 deletions.
7 changes: 0 additions & 7 deletions arch/s390/boot/mem_detect.c
Original file line number Diff line number Diff line change
@@ -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;
12 changes: 12 additions & 0 deletions arch/s390/include/asm/mem_detect.h
Original file line number Diff line number Diff line change
@@ -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
12 changes: 0 additions & 12 deletions arch/s390/mm/kasan_init.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 9b69210

Please sign in to comment.