Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754935AbdLODda (ORCPT ); Thu, 14 Dec 2017 22:33:30 -0500 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:38054 "EHLO cmccmta2.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754797AbdLODd2 (ORCPT ); Thu, 14 Dec 2017 22:33:28 -0500 X-RM-TRANSID: 2ee85a334285f1b-31a2b X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee65a334282b14-d35cf 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 1/7] mm/memblock: memblock_is_map/region_memory can be boolean Date: Thu, 14 Dec 2017 22:33:13 -0500 Message-Id: <1513308799-19232-2-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: 2131 Lines: 59 This patch makes memblock_is_map/region_memory return bool due to these two functions only using either true or false as its return value. No functional change. Signed-off-by: Yaowei Bai --- include/linux/memblock.h | 4 ++-- mm/memblock.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 7ed0f77..8be5077 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -332,8 +332,8 @@ phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align, void memblock_cap_memory_range(phys_addr_t base, phys_addr_t size); void memblock_mem_limit_remove_map(phys_addr_t limit); bool memblock_is_memory(phys_addr_t addr); -int memblock_is_map_memory(phys_addr_t addr); -int memblock_is_region_memory(phys_addr_t base, phys_addr_t size); +bool memblock_is_map_memory(phys_addr_t addr); +bool memblock_is_region_memory(phys_addr_t base, phys_addr_t size); bool memblock_is_reserved(phys_addr_t addr); bool memblock_is_region_reserved(phys_addr_t base, phys_addr_t size); diff --git a/mm/memblock.c b/mm/memblock.c index 46aacdf..5a9ca2a 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1654,7 +1654,7 @@ bool __init_memblock memblock_is_memory(phys_addr_t addr) return memblock_search(&memblock.memory, addr) != -1; } -int __init_memblock memblock_is_map_memory(phys_addr_t addr) +bool __init_memblock memblock_is_map_memory(phys_addr_t addr) { int i = memblock_search(&memblock.memory, addr); @@ -1690,13 +1690,13 @@ int __init_memblock memblock_search_pfn_nid(unsigned long pfn, * RETURNS: * 0 if false, non-zero if true */ -int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size) +bool __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size) { int idx = memblock_search(&memblock.memory, base); phys_addr_t end = base + memblock_cap_size(base, &size); if (idx == -1) - return 0; + return false; return (memblock.memory.regions[idx].base + memblock.memory.regions[idx].size) >= end; } -- 1.8.3.1