aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaowei Bai <baiyaowei@cmss.chinamobile.com>2018-02-06 18:41:38 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-06 21:32:47 -0500
commit2650cb0c3ba7eb93d4c9af632549a93110c91af7 (patch)
treeb9b3cd78fcd629bbf61cc2e2953583000a647c80
parentdb076bef2da1f81bf918fc0b24ebed5756fbae5a (diff)
crash_dump: is_kdump_kernel can be boolean
Make is_kdump_kernel return bool due to this particular function only using either one or zero as its return value. No functional change. Link: http://lkml.kernel.org/r/1513308799-19232-8-git-send-email-baiyaowei@cmss.chinamobile.com Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/crash_dump.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index a992e6ca2f1c..f7ac2aa93269 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -2,13 +2,13 @@
2#ifndef LINUX_CRASH_DUMP_H 2#ifndef LINUX_CRASH_DUMP_H
3#define LINUX_CRASH_DUMP_H 3#define LINUX_CRASH_DUMP_H
4 4
5#ifdef CONFIG_CRASH_DUMP
6#include <linux/kexec.h> 5#include <linux/kexec.h>
7#include <linux/proc_fs.h> 6#include <linux/proc_fs.h>
8#include <linux/elf.h> 7#include <linux/elf.h>
9 8
10#include <asm/pgtable.h> /* for pgprot_t */ 9#include <asm/pgtable.h> /* for pgprot_t */
11 10
11#ifdef CONFIG_CRASH_DUMP
12#define ELFCORE_ADDR_MAX (-1ULL) 12#define ELFCORE_ADDR_MAX (-1ULL)
13#define ELFCORE_ADDR_ERR (-2ULL) 13#define ELFCORE_ADDR_ERR (-2ULL)
14 14
@@ -52,13 +52,13 @@ void vmcore_cleanup(void);
52 * has passed the elf core header address on command line. 52 * has passed the elf core header address on command line.
53 * 53 *
54 * This is not just a test if CONFIG_CRASH_DUMP is enabled or not. It will 54 * This is not just a test if CONFIG_CRASH_DUMP is enabled or not. It will
55 * return 1 if CONFIG_CRASH_DUMP=y and if kernel is booting after a panic of 55 * return true if CONFIG_CRASH_DUMP=y and if kernel is booting after a panic
56 * previous kernel. 56 * of previous kernel.
57 */ 57 */
58 58
59static inline int is_kdump_kernel(void) 59static inline bool is_kdump_kernel(void)
60{ 60{
61 return (elfcorehdr_addr != ELFCORE_ADDR_MAX) ? 1 : 0; 61 return elfcorehdr_addr != ELFCORE_ADDR_MAX;
62} 62}
63 63
64/* is_vmcore_usable() checks if the kernel is booting after a panic and 64/* is_vmcore_usable() checks if the kernel is booting after a panic and
@@ -89,7 +89,7 @@ extern int register_oldmem_pfn_is_ram(int (*fn)(unsigned long pfn));
89extern void unregister_oldmem_pfn_is_ram(void); 89extern void unregister_oldmem_pfn_is_ram(void);
90 90
91#else /* !CONFIG_CRASH_DUMP */ 91#else /* !CONFIG_CRASH_DUMP */
92static inline int is_kdump_kernel(void) { return 0; } 92static inline bool is_kdump_kernel(void) { return 0; }
93#endif /* CONFIG_CRASH_DUMP */ 93#endif /* CONFIG_CRASH_DUMP */
94 94
95extern unsigned long saved_max_pfn; 95extern unsigned long saved_max_pfn;