From patchwork Thu Sep 15 02:56:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhaoyang.huang" X-Patchwork-Id: 12976791 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95017ECAAD8 for ; Thu, 15 Sep 2022 02:57:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 11D508D0001; Wed, 14 Sep 2022 22:57:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0CC366B0073; Wed, 14 Sep 2022 22:57:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED5BF8D0001; Wed, 14 Sep 2022 22:57:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id DDD576B0071 for ; Wed, 14 Sep 2022 22:57:32 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B65F11A0798 for ; Thu, 15 Sep 2022 02:57:32 +0000 (UTC) X-FDA: 79912809144.05.62A4D6B Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf30.hostedemail.com (Postfix) with ESMTP id C496D800CD for ; Thu, 15 Sep 2022 02:57:31 +0000 (UTC) Received: from SHSend.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by SHSQR01.spreadtrum.com with ESMTPS id 28F2v0HI044030 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Thu, 15 Sep 2022 10:57:00 +0800 (CST) (envelope-from zhaoyang.huang@unisoc.com) Received: from bj03382pcu.spreadtrum.com (10.0.74.65) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 15 Sep 2022 10:56:59 +0800 From: "zhaoyang.huang" To: Andrew Morton , Zhaoyang Huang , , , Subject: [PATCH] mm: change the type to bool for page_has_xxx's val Date: Thu, 15 Sep 2022 10:56:40 +0800 Message-ID: <1663210600-29258-1-git-send-email-zhaoyang.huang@unisoc.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.0.74.65] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 28F2v0HI044030 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663210652; a=rsa-sha256; cv=none; b=4za3PG60inA8j0GqxbsFDpsiXMFbl+eb2iCbFuQHOqBdhTYOwGQokbAohc9m+5Jb/0k7ph p+ztcTQ+C9FoTh6YYQPKlmqvMrUbctfqk4GAByQ33SgSZ2WuJekOQJcBlnC8vQZg7vrigV bDaxL07KpR/CAHxVa+0dAKUxdyvkfcA= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf30.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663210652; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references; bh=lQMDg9dJgpJiedNfV5Lo7d4z98SD20KW1Q48U48Fqns=; b=PxjyGpwnylnJf50M8JjgVTJ9w364+PrctI8hdBzYdjMRPhaeRsW8FEGlHDKQjAZq7wQGgv pZIWHm6iv95Iq79mPJKe73bWTSInw/3bK0tgNKLk65Uue1bO5GodhE1gOhtH8qA/qtrQzY /02uFSKR+1BLhDxx+orhNAQWLuD0KH8= X-Stat-Signature: s65czro3yjbkai7hbsogi7qer5bu7k36 X-Rspamd-Queue-Id: C496D800CD X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf30.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com X-Rspamd-Server: rspam02 X-HE-Tag: 1663210651-360346 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Zhaoyang Huang It is proper to return bool value for such functions Signed-off-by: Zhaoyang Huang --- include/linux/page-flags.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index e66f7aa..9a46c8b 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -946,9 +946,9 @@ static inline bool is_page_hwpoison(struct page *page) #define PageType(page, flag) \ ((page->page_type & (PAGE_TYPE_BASE | flag)) == PAGE_TYPE_BASE) -static inline int page_has_type(struct page *page) +static inline bool page_has_type(struct page *page) { - return (int)page->page_type < PAGE_MAPCOUNT_RESERVE; + return !!((int)page->page_type < PAGE_MAPCOUNT_RESERVE); } #define PAGE_TYPE_OPS(uname, lname) \ @@ -1081,7 +1081,7 @@ static __always_inline void __ClearPageAnonExclusive(struct page *page) * Determine if a page has private stuff, indicating that release routines * should be invoked upon it. */ -static inline int page_has_private(struct page *page) +static inline bool page_has_private(struct page *page) { return !!(page->flags & PAGE_FLAGS_PRIVATE); }