From 2134aff49178f57940343d7c14ec16f6b39dbd12 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Fri, 4 Feb 2022 11:42:12 +0000 Subject: [PATCH] zipl/boot: kdump: remove static struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makes the code easier to read since it can have less side effects. Signed-off-by: Marc Hartmayer Reviewed-by: Steffen Eiden Reviewed-by: Stefan Haberland Signed-off-by: Jan Höppner --- zipl/boot/kdump2.c | 6 ++---- zipl/boot/kdump3.c | 7 ++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/zipl/boot/kdump2.c b/zipl/boot/kdump2.c index b684b22d..f461c4d7 100644 --- a/zipl/boot/kdump2.c +++ b/zipl/boot/kdump2.c @@ -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); } diff --git a/zipl/boot/kdump3.c b/zipl/boot/kdump3.c index 5d118dde..caa730c1 100644 --- a/zipl/boot/kdump3.c +++ b/zipl/boot/kdump3.c @@ -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; } /*