diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2024-12-13 00:59:26 +0100 |
---|---|---|
committer | Alexander Gordeev <agordeev@linux.ibm.com> | 2025-01-26 17:23:58 +0100 |
commit | 02415f1cf435ac1403743156c21b79f52adee6ab (patch) | |
tree | 4a137c8cea74013adf1ac605ab0162c1f484bf5c | |
parent | e70452c4ba2ce1e24a3fdc18bd623edb7b56013c (diff) | |
download | linux-02415f1cf435ac1403743156c21b79f52adee6ab.tar.gz linux-02415f1cf435ac1403743156c21b79f52adee6ab.tar.bz2 linux-02415f1cf435ac1403743156c21b79f52adee6ab.zip |
s390/boot: Rename physmem_alloc_top_down() to physmem_alloc_or_die()
The new name better reflects the function's behavior, emphasizing that
it will terminate execution if allocation fails.
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
-rw-r--r-- | arch/s390/boot/boot.h | 4 | ||||
-rw-r--r-- | arch/s390/boot/ipl_report.c | 2 | ||||
-rw-r--r-- | arch/s390/boot/kaslr.c | 2 | ||||
-rw-r--r-- | arch/s390/boot/physmem_info.c | 4 | ||||
-rw-r--r-- | arch/s390/boot/startup.c | 2 | ||||
-rw-r--r-- | arch/s390/boot/vmem.c | 6 |
6 files changed, 10 insertions, 10 deletions
diff --git a/arch/s390/boot/boot.h b/arch/s390/boot/boot.h index 56244fe78182..f26902624650 100644 --- a/arch/s390/boot/boot.h +++ b/arch/s390/boot/boot.h @@ -47,8 +47,8 @@ void physmem_set_usable_limit(unsigned long limit); void physmem_reserve(enum reserved_range_type type, unsigned long addr, unsigned long size); void physmem_free(enum reserved_range_type type); /* for continuous/multiple allocations per type */ -unsigned long physmem_alloc_top_down(enum reserved_range_type type, unsigned long size, - unsigned long align); +unsigned long physmem_alloc_or_die(enum reserved_range_type type, unsigned long size, + unsigned long align); /* for single allocations, 1 per type */ unsigned long physmem_alloc_range(enum reserved_range_type type, unsigned long size, unsigned long align, unsigned long min, unsigned long max, diff --git a/arch/s390/boot/ipl_report.c b/arch/s390/boot/ipl_report.c index d00898852a88..aea22e268c65 100644 --- a/arch/s390/boot/ipl_report.c +++ b/arch/s390/boot/ipl_report.c @@ -155,7 +155,7 @@ void save_ipl_cert_comp_list(void) return; size = get_cert_comp_list_size(); - early_ipl_comp_list_addr = physmem_alloc_top_down(RR_CERT_COMP_LIST, size, sizeof(int)); + early_ipl_comp_list_addr = physmem_alloc_or_die(RR_CERT_COMP_LIST, size, sizeof(int)); ipl_cert_list_addr = early_ipl_comp_list_addr + early_ipl_comp_list_size; copy_components_bootdata(); diff --git a/arch/s390/boot/kaslr.c b/arch/s390/boot/kaslr.c index f864d2bff775..d6761e1e2f8d 100644 --- a/arch/s390/boot/kaslr.c +++ b/arch/s390/boot/kaslr.c @@ -168,7 +168,7 @@ static unsigned long iterate_valid_positions(unsigned long size, unsigned long a * cannot have chains. * * On the other hand, "dynamic" or "repetitive" allocations are done via - * physmem_alloc_top_down(). These allocations are tightly packed together + * physmem_alloc_or_die(). These allocations are tightly packed together * top down from the end of online memory. physmem_alloc_pos represents * current position where those allocations start. * diff --git a/arch/s390/boot/physmem_info.c b/arch/s390/boot/physmem_info.c index 7617aa2d2f7e..34d310a6d8a5 100644 --- a/arch/s390/boot/physmem_info.c +++ b/arch/s390/boot/physmem_info.c @@ -343,8 +343,8 @@ unsigned long physmem_alloc_range(enum reserved_range_type type, unsigned long s return addr; } -unsigned long physmem_alloc_top_down(enum reserved_range_type type, unsigned long size, - unsigned long align) +unsigned long physmem_alloc_or_die(enum reserved_range_type type, unsigned long size, + unsigned long align) { struct reserved_range *range = &physmem_info.reserved[type]; struct reserved_range *new_range; diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c index e00aed22d0d4..70f90a19007a 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -143,7 +143,7 @@ static void rescue_initrd(unsigned long min, unsigned long max) return; old_addr = addr; physmem_free(RR_INITRD); - addr = physmem_alloc_top_down(RR_INITRD, size, 0); + addr = physmem_alloc_or_die(RR_INITRD, size, 0); memmove((void *)addr, (void *)old_addr, size); } diff --git a/arch/s390/boot/vmem.c b/arch/s390/boot/vmem.c index d755e5340fcd..3e69e4405d70 100644 --- a/arch/s390/boot/vmem.c +++ b/arch/s390/boot/vmem.c @@ -201,7 +201,7 @@ static void *boot_crst_alloc(unsigned long val) unsigned long size = PAGE_SIZE << CRST_ALLOC_ORDER; unsigned long *table; - table = (unsigned long *)physmem_alloc_top_down(RR_VMEM, size, size); + table = (unsigned long *)physmem_alloc_or_die(RR_VMEM, size, size); crst_table_init(table, val); __arch_set_page_dat(table, 1UL << CRST_ALLOC_ORDER); return table; @@ -217,7 +217,7 @@ static pte_t *boot_pte_alloc(void) * during POPULATE_KASAN_MAP_SHADOW when EDAT is off */ if (!pte_leftover) { - pte_leftover = (void *)physmem_alloc_top_down(RR_VMEM, PAGE_SIZE, PAGE_SIZE); + pte_leftover = (void *)physmem_alloc_or_die(RR_VMEM, PAGE_SIZE, PAGE_SIZE); pte = pte_leftover + _PAGE_TABLE_SIZE; __arch_set_page_dat(pte, 1); } else { @@ -247,7 +247,7 @@ static unsigned long resolve_pa_may_alloc(unsigned long addr, unsigned long size return __identity_pa(addr); #ifdef CONFIG_KASAN case POPULATE_KASAN_MAP_SHADOW: - addr = physmem_alloc_top_down(RR_VMEM, size, size); + addr = physmem_alloc_or_die(RR_VMEM, size, size); memset((void *)addr, 0, size); return addr; #endif |