Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755014AbdLODdy (ORCPT ); Thu, 14 Dec 2017 22:33:54 -0500 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:47017 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754946AbdLODdf (ORCPT ); Thu, 14 Dec 2017 22:33:35 -0500 X-RM-TRANSID: 2ee25a33428d323-31d90 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee65a334282b14-d362b From: Yaowei Bai To: akpm@linux-foundation.org, rdunlap@infradead.org, rientjes@google.com, joe@perches.com Cc: linux-kernel@vger.kernel.org, baiyaowei@cmss.chinamobile.com Subject: [PATCH 7/7] crash_dump: is_kdump_kernel can be boolean Date: Thu, 14 Dec 2017 22:33:19 -0500 Message-Id: <1513308799-19232-8-git-send-email-baiyaowei@cmss.chinamobile.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1513308799-19232-1-git-send-email-baiyaowei@cmss.chinamobile.com> References: <1513308799-19232-1-git-send-email-baiyaowei@cmss.chinamobile.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1836 Lines: 60 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 --- include/linux/crash_dump.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index a992e6c..f7ac2aa 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h @@ -2,13 +2,13 @@ #ifndef LINUX_CRASH_DUMP_H #define LINUX_CRASH_DUMP_H -#ifdef CONFIG_CRASH_DUMP #include #include #include #include /* for pgprot_t */ +#ifdef CONFIG_CRASH_DUMP #define ELFCORE_ADDR_MAX (-1ULL) #define ELFCORE_ADDR_ERR (-2ULL) @@ -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 0; } #endif /* CONFIG_CRASH_DUMP */ extern unsigned long saved_max_pfn; -- 1.8.3.1