zipl/boot: kdump: remove static struct

Makes the code easier to read since it can have less side effects.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2022-02-04 11:42:12 +00:00
committed by Jan Höppner
parent b41ac66f36
commit 2134aff491
2 changed files with 6 additions and 7 deletions

View File

@@ -15,8 +15,6 @@
#include "menu.h"
#include "stage2.h"
static struct os_info **lc_os_info = ((struct os_info **)&S390_lowcore.os_info);
/*
* Copy crashkernel memory from [0, crash size] to
* [crash base, crash base + crash size] if config_nr specifies a
@@ -27,7 +25,7 @@ static struct os_info **lc_os_info = ((struct os_info **)&S390_lowcore.os_info);
*/
void kdump_stage2(unsigned long config_nr)
{
struct os_info *os_info = *lc_os_info;
struct os_info *os_info = (struct os_info *)S390_lowcore.os_info;
unsigned long crash_size;
void *crash_base;
@@ -45,5 +43,5 @@ void kdump_stage2(unsigned long config_nr)
*/
if (__pa(os_info) >= crash_size)
return;
*lc_os_info = (void *) __pa(os_info) + __pa(crash_base);
S390_lowcore.os_info = __pa(os_info) + __pa(crash_base);
}

View File

@@ -15,7 +15,6 @@
#include "sclp_stage3.h"
#include "stage3.h"
static struct os_info **lc_os_info = (struct os_info **)&S390_lowcore.os_info;
/*
* Copy memory from HSA and exit in case of an error
@@ -89,8 +88,10 @@ static void kdump_stage3_scsi(unsigned long *base, unsigned long *size)
*/
static void kdump_stage3_dasd(unsigned long *base, unsigned long *size)
{
*base = (*lc_os_info)->crashkernel_addr;
*size = (*lc_os_info)->crashkernel_size;
struct os_info *lc_os_info = (struct os_info *)S390_lowcore.os_info;
*base = lc_os_info->crashkernel_addr;
*size = lc_os_info->crashkernel_size;
}
/*