Commit 606134f7 authored by Borislav Petkov's avatar Borislav Petkov Committed by Ingo Molnar

x86/setup/crash: Remove alignment variable

Use a macro instead. No functionality change.
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Reviewed-by: default avatarDave Young <dyoung@redhat.com>
Reviewed-by: default avatarJoerg Roedel <jroedel@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Salter <msalter@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: WANG Chao <chaowang@redhat.com>
Cc: jerry_hoemann@hp.com
Link: http://lkml.kernel.org/r/1445246268-26285-5-git-send-email-bp@alien8.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 97eac21b
...@@ -480,6 +480,9 @@ static void __init memblock_x86_reserve_range_setup_data(void) ...@@ -480,6 +480,9 @@ static void __init memblock_x86_reserve_range_setup_data(void)
#ifdef CONFIG_KEXEC_CORE #ifdef CONFIG_KEXEC_CORE
/* 16M alignment for crash kernel regions */
#define CRASH_ALIGN (16 << 20)
/* /*
* Keep the crash kernel below this limit. On 32 bits earlier kernels * Keep the crash kernel below this limit. On 32 bits earlier kernels
* would limit the kernel to the low 512 MiB due to mapping restrictions. * would limit the kernel to the low 512 MiB due to mapping restrictions.
...@@ -496,7 +499,6 @@ static void __init memblock_x86_reserve_range_setup_data(void) ...@@ -496,7 +499,6 @@ static void __init memblock_x86_reserve_range_setup_data(void)
static int __init reserve_crashkernel_low(void) static int __init reserve_crashkernel_low(void)
{ {
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
const unsigned long long alignment = 16<<20; /* 16M */
unsigned long long low_base = 0, low_size = 0; unsigned long long low_base = 0, low_size = 0;
unsigned long total_low_mem; unsigned long total_low_mem;
unsigned long long base; unsigned long long base;
...@@ -525,7 +527,7 @@ static int __init reserve_crashkernel_low(void) ...@@ -525,7 +527,7 @@ static int __init reserve_crashkernel_low(void)
return 0; return 0;
} }
low_base = memblock_find_in_range(low_size, 1ULL << 32, low_size, alignment); low_base = memblock_find_in_range(low_size, 1ULL << 32, low_size, CRASH_ALIGN);
if (!low_base) { if (!low_base) {
pr_err("Cannot reserve %ldMB crashkernel low memory, please try smaller size.\n", pr_err("Cannot reserve %ldMB crashkernel low memory, please try smaller size.\n",
(unsigned long)(low_size >> 20)); (unsigned long)(low_size >> 20));
...@@ -548,7 +550,6 @@ static int __init reserve_crashkernel_low(void) ...@@ -548,7 +550,6 @@ static int __init reserve_crashkernel_low(void)
static void __init reserve_crashkernel(void) static void __init reserve_crashkernel(void)
{ {
const unsigned long long alignment = 16<<20; /* 16M */
unsigned long long total_mem; unsigned long long total_mem;
unsigned long long crash_size, crash_base; unsigned long long crash_size, crash_base;
bool high = false; bool high = false;
...@@ -572,10 +573,10 @@ static void __init reserve_crashkernel(void) ...@@ -572,10 +573,10 @@ static void __init reserve_crashkernel(void)
/* /*
* kexec want bzImage is below CRASH_KERNEL_ADDR_MAX * kexec want bzImage is below CRASH_KERNEL_ADDR_MAX
*/ */
crash_base = memblock_find_in_range(alignment, crash_base = memblock_find_in_range(CRASH_ALIGN,
high ? CRASH_ADDR_HIGH_MAX high ? CRASH_ADDR_HIGH_MAX
: CRASH_ADDR_LOW_MAX, : CRASH_ADDR_LOW_MAX,
crash_size, alignment); crash_size, CRASH_ALIGN);
if (!crash_base) { if (!crash_base) {
pr_info("crashkernel reservation failed - No suitable area found.\n"); pr_info("crashkernel reservation failed - No suitable area found.\n");
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment