[PATCH 8/8] crash_dump: is_kdump_kernel can be boolean
From: Yaowei Bai
Date: Mon Dec 11 2017 - 21:56:38 EST
This patch makes is_kdump_kernel return bool due to this particular
function only using either one or zero as its return value.
No functional change.
Signed-off-by: Yaowei Bai <baiyaowei@xxxxxxxxxxxxxxxxxxxx>
---
include/linux/crash_dump.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index a992e6c..8b0c711 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -52,13 +52,13 @@ extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
* has passed the elf core header address on command line.
*
* This is not just a test if CONFIG_CRASH_DUMP is enabled or not. It will
- * return 1 if CONFIG_CRASH_DUMP=y and if kernel is booting after a panic of
- * previous kernel.
+ * return true if CONFIG_CRASH_DUMP=y and if kernel is booting after a panic
+ * of previous kernel.
*/
-static inline int is_kdump_kernel(void)
+static inline bool is_kdump_kernel(void)
{
- return (elfcorehdr_addr != ELFCORE_ADDR_MAX) ? 1 : 0;
+ return elfcorehdr_addr != ELFCORE_ADDR_MAX;
}
/* is_vmcore_usable() checks if the kernel is booting after a panic and
@@ -89,7 +89,7 @@ static inline void vmcore_unusable(void)
extern void unregister_oldmem_pfn_is_ram(void);
#else /* !CONFIG_CRASH_DUMP */
-static inline int is_kdump_kernel(void) { return 0; }
+static inline bool is_kdump_kernel(void) { return false; }
#endif /* CONFIG_CRASH_DUMP */
extern unsigned long saved_max_pfn;
--
1.8.3.1