[tip:ras/core] x86/setup/crash: Cleanup some more

2015-10-21 Thread tip-bot for Borislav Petkov
Commit-ID:  f56d55781c1ff5663874775d0672ba954fe5634c
Gitweb: http://git.kernel.org/tip/f56d55781c1ff5663874775d0672ba954fe5634c
Author: Borislav Petkov 
AuthorDate: Mon, 19 Oct 2015 11:17:45 +0200
Committer:  Ingo Molnar 
CommitDate: Wed, 21 Oct 2015 11:10:56 +0200

x86/setup/crash: Cleanup some more

* Remove unused auto_set variable
* Cleanup local function variable declarations
* Reformat printk string and use pr_info()

No functionality change.

Signed-off-by: Borislav Petkov 
Reviewed-by: Dave Young 
Reviewed-by: Joerg Roedel 
Cc: Andrew Morton 
Cc: Andy Lutomirski 
Cc: H. Peter Anvin 
Cc: Jiri Kosina 
Cc: Juergen Gross 
Cc: Linus Torvalds 
Cc: Mark Salter 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Cc: WANG Chao 
Cc: jerry_hoem...@hp.com
Link: http://lkml.kernel.org/r/1445246268-26285-6-git-send-email...@alien8.de
Signed-off-by: Ingo Molnar 
---
 arch/x86/kernel/setup.c | 19 +++
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index ea086dd..d478871 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -499,17 +499,15 @@ static void __init 
memblock_x86_reserve_range_setup_data(void)
 static int __init reserve_crashkernel_low(void)
 {
 #ifdef CONFIG_X86_64
-   unsigned long long low_base = 0, low_size = 0;
+   unsigned long long base, low_base = 0, low_size = 0;
unsigned long total_low_mem;
-   unsigned long long base;
-   bool auto_set = false;
int ret;
 
total_low_mem = memblock_mem_size(1UL << (32 - PAGE_SHIFT));
 
/* crashkernel=Y,low */
ret = parse_crashkernel_low(boot_command_line, total_low_mem, 
_size, );
-   if (ret != 0) {
+   if (ret) {
/*
 * two parts from lib/swiotlb.c:
 * -swiotlb size: user-specified with swiotlb= or default.
@@ -520,7 +518,6 @@ static int __init reserve_crashkernel_low(void)
 * don't run out of DMA buffers for 32-bit devices.
 */
low_size = max(swiotlb_size_or_default() + (8UL << 20), 256UL 
<< 20);
-   auto_set = true;
} else {
/* passed with crashkernel=0,low ? */
if (!low_size)
@@ -550,8 +547,7 @@ static int __init reserve_crashkernel_low(void)
 
 static void __init reserve_crashkernel(void)
 {
-   unsigned long long total_mem;
-   unsigned long long crash_size, crash_base;
+   unsigned long long crash_size, crash_base, total_mem;
bool high = false;
int ret;
 
@@ -600,11 +596,10 @@ static void __init reserve_crashkernel(void)
return;
}
 
-   printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
-   "for crashkernel (System RAM: %ldMB)\n",
-   (unsigned long)(crash_size >> 20),
-   (unsigned long)(crash_base >> 20),
-   (unsigned long)(total_mem >> 20));
+   pr_info("Reserving %ldMB of memory at %ldMB for crashkernel (System 
RAM: %ldMB)\n",
+   (unsigned long)(crash_size >> 20),
+   (unsigned long)(crash_base >> 20),
+   (unsigned long)(total_mem >> 20));
 
crashk_res.start = crash_base;
crashk_res.end   = crash_base + crash_size - 1;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:ras/core] x86/setup/crash: Cleanup some more

2015-10-21 Thread tip-bot for Borislav Petkov
Commit-ID:  f56d55781c1ff5663874775d0672ba954fe5634c
Gitweb: http://git.kernel.org/tip/f56d55781c1ff5663874775d0672ba954fe5634c
Author: Borislav Petkov 
AuthorDate: Mon, 19 Oct 2015 11:17:45 +0200
Committer:  Ingo Molnar 
CommitDate: Wed, 21 Oct 2015 11:10:56 +0200

x86/setup/crash: Cleanup some more

* Remove unused auto_set variable
* Cleanup local function variable declarations
* Reformat printk string and use pr_info()

No functionality change.

Signed-off-by: Borislav Petkov 
Reviewed-by: Dave Young 
Reviewed-by: Joerg Roedel 
Cc: Andrew Morton 
Cc: Andy Lutomirski 
Cc: H. Peter Anvin 
Cc: Jiri Kosina 
Cc: Juergen Gross 
Cc: Linus Torvalds 
Cc: Mark Salter 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Cc: WANG Chao 
Cc: jerry_hoem...@hp.com
Link: http://lkml.kernel.org/r/1445246268-26285-6-git-send-email...@alien8.de
Signed-off-by: Ingo Molnar 
---
 arch/x86/kernel/setup.c | 19 +++
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index ea086dd..d478871 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -499,17 +499,15 @@ static void __init 
memblock_x86_reserve_range_setup_data(void)
 static int __init reserve_crashkernel_low(void)
 {
 #ifdef CONFIG_X86_64
-   unsigned long long low_base = 0, low_size = 0;
+   unsigned long long base, low_base = 0, low_size = 0;
unsigned long total_low_mem;
-   unsigned long long base;
-   bool auto_set = false;
int ret;
 
total_low_mem = memblock_mem_size(1UL << (32 - PAGE_SHIFT));
 
/* crashkernel=Y,low */
ret = parse_crashkernel_low(boot_command_line, total_low_mem, 
_size, );
-   if (ret != 0) {
+   if (ret) {
/*
 * two parts from lib/swiotlb.c:
 * -swiotlb size: user-specified with swiotlb= or default.
@@ -520,7 +518,6 @@ static int __init reserve_crashkernel_low(void)
 * don't run out of DMA buffers for 32-bit devices.
 */
low_size = max(swiotlb_size_or_default() + (8UL << 20), 256UL 
<< 20);
-   auto_set = true;
} else {
/* passed with crashkernel=0,low ? */
if (!low_size)
@@ -550,8 +547,7 @@ static int __init reserve_crashkernel_low(void)
 
 static void __init reserve_crashkernel(void)
 {
-   unsigned long long total_mem;
-   unsigned long long crash_size, crash_base;
+   unsigned long long crash_size, crash_base, total_mem;
bool high = false;
int ret;
 
@@ -600,11 +596,10 @@ static void __init reserve_crashkernel(void)
return;
}
 
-   printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
-   "for crashkernel (System RAM: %ldMB)\n",
-   (unsigned long)(crash_size >> 20),
-   (unsigned long)(crash_base >> 20),
-   (unsigned long)(total_mem >> 20));
+   pr_info("Reserving %ldMB of memory at %ldMB for crashkernel (System 
RAM: %ldMB)\n",
+   (unsigned long)(crash_size >> 20),
+   (unsigned long)(crash_base >> 20),
+   (unsigned long)(total_mem >> 20));
 
crashk_res.start = crash_base;
crashk_res.end   = crash_base + crash_size - 1;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/