The bootup command line option crashkernel=Y,low is valid only when
crashkernel=X,high is specified. Putting their parsing into a separate
function makes the code logic clearer and easier to understand the strong
dependencies between them. So add parse_crashkernel_high_low() and use it
to repalce parse_crashkernel_{high|low}(). Then make the latter static,
and reduce two confusing parameters 'system_ram' and 'crash_base' of them.
All four patches in this series do the cleanups, no functional change. This
patchset is also a preparation for supporting reserve crashkernel above 4G
on arm64, and share code with x86.
The main proposal was made by Borislav Petkov.As I've already alluded to in another mail, ontop of this there should
be a patch or multiple patches which clean this up more and perhaps even
split it into separate functions doing stuff in this order:
1. Parse all crashkernel= cmdline options
2. Do all crash_base, crash_size etc checks
3. Do the memory reservations
And all that supplied with comments explaining why stuff is being done.
Zhen Lei (4):
kdump: add helper parse_crashkernel_high_low()
x86/setup: Use parse_crashkernel_high_low() to simplify code
kdump: make parse_crashkernel_{high|low}() static
kdump: reduce unnecessary parameters of parse_crashkernel_{high|low}()
arch/x86/kernel/setup.c | 21 +++++++--------
include/linux/crash_core.h | 7 +++--
kernel/crash_core.c | 54 +++++++++++++++++++++++++++++++-------
3 files changed, 56 insertions(+), 26 deletions(-)
--
2.25.1