Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE"
by a check for "IS_ENABLED(CONFIG_BLK_DEV_INITRD)", to simplify the
code and increase compile coverage.
I only modifies x86, arm, arm64 and riscv, other arch are not touched.
If the idea is accepted, I will modify all architectures code.
Jisheng Zhang (5):
kexec: make crashk_res, crashk_low_res and crash_notes symbols always
visible
riscv: mm: init: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef
x86/setup: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef
arm64: mm: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef
arm: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef
arch/arm/kernel/setup.c | 7 +++----
arch/arm64/mm/init.c | 9 +++------
arch/riscv/mm/init.c | 6 ++----
arch/x86/kernel/setup.c | 10 +++-------
include/linux/kexec.h | 12 ++++++------
5 files changed, 17 insertions(+), 27 deletions(-)
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Make the forward declarations of crashk_res, crashk_low_res and
crash_notes always visible. Code referring to these symbols can then
just check for IS_ENABLED(CONFIG_KEXEC_CORE), instead of requiring
conditional compilation using an #ifdef, thus preparing to increase
compile coverage and simplify the code.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
include/linux/kexec.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
@@ -20,6 +20,12 @@#include<uapi/linux/kexec.h>+/* Location of a reserved region to hold the crash kernel.+*/+externstructresourcecrashk_res;+externstructresourcecrashk_low_res;+externnote_buf_t__percpu*crash_notes;+#ifdef CONFIG_KEXEC_CORE#include<linux/list.h>#include<linux/compat.h>
@@ -350,12 +356,6 @@ extern int kexec_load_disabled;#define KEXEC_FILE_FLAGS (KEXEC_FILE_UNLOAD | KEXEC_FILE_ON_CRASH | \KEXEC_FILE_NO_INITRAMFS)-/* Location of a reserved region to hold the crash kernel.-*/-externstructresourcecrashk_res;-externstructresourcecrashk_low_res;-externnote_buf_t__percpu*crash_notes;-/* flag to track if kexec reboot is in progress */externboolkexec_in_progress;
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE"
by a check for "IS_ENABLED(CONFIG_BLK_DEV_INITRD)", to simplify the
code and increase compile coverage.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
arch/riscv/mm/init.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE"
by a check for "IS_ENABLED(CONFIG_BLK_DEV_INITRD)", to simplify the
code and increase compile coverage.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
arch/x86/kernel/setup.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE"
by a check for "IS_ENABLED(CONFIG_BLK_DEV_INITRD)", to simplify the
code and increase compile coverage.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
arch/arm64/mm/init.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
@@ -78,6 +77,9 @@ static void __init reserve_crashkernel(void)unsignedlonglongcrash_max=arm64_dma_phys_limit;intret;+if(!IS_ENABLED(CONFIG_KEXEC_CORE))+return;+ret=parse_crashkernel(boot_command_line,memblock_phys_mem_size(),&crash_size,&crash_base);/* no crashkernel= or invalid value specified */
On Fri, Dec 03, 2021 at 01:11:56PM +0800, Jisheng Zhang wrote:
Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE"
by a check for "IS_ENABLED(CONFIG_BLK_DEV_INITRD)", to simplify the
code and increase compile coverage.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
As long as it still compiles:
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE"
by a check for "IS_ENABLED(CONFIG_BLK_DEV_INITRD)", to simplify the
code and increase compile coverage.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
arch/arm/kernel/setup.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
From: "Russell King (Oracle)" <linux@armlinux.org.uk> Date: 2021-12-03 16:24:36
On Fri, Dec 03, 2021 at 01:11:57PM +0800, Jisheng Zhang wrote:
Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE"
by a check for "IS_ENABLED(CONFIG_BLK_DEV_INITRD)", to simplify the
code and increase compile coverage.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>