From patchwork Fri Aug 4 01:25:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13341043 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 4B77AEB64DD for ; Fri, 4 Aug 2023 01:26:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 61C242802AB; Thu, 3 Aug 2023 21:26:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 277E72802AF; Thu, 3 Aug 2023 21:26:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EED282802AE; Thu, 3 Aug 2023 21:26:14 -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 A87E32802B0 for ; Thu, 3 Aug 2023 21:26:14 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 79C021212AB for ; Fri, 4 Aug 2023 01:26:14 +0000 (UTC) X-FDA: 81084681468.04.9FC67C4 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf15.hostedemail.com (Postfix) with ESMTP id 5CBB9A0015 for ; Fri, 4 Aug 2023 01:26:11 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691112372; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JXkvt1bhEq1AJ2Xm6oqcZGFB5TUOlRnZ9UKgw3zkuyI=; b=tjtDKnDXk+D1r2OGkH4jUKOVYuo/eHMEvqM8ACyGZUkJ09IeGeNcSc8aBjMt5HnL93Jsmq wEgHR/nRvfTrW2Jng+b6SZOTsHgKvOuZ1om4H6/qOpCEkj1skuJ4jYj9D/92rsQiuagko2 1ld8zpJ8sXrMKOzd4dnvqQyBE9/0H8w= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691112372; a=rsa-sha256; cv=none; b=fK4+Wb1aMW7ByEKPBnwCEb5lWehy1zvCkki+1GJyLnqtoDoCQ6SWQ0CCOpc76uwOGbL6pF ON2yuNfDSO+xGeI0EDMAZCYgQspqbiBX4CwnPVPVSWIYxzL7OSS08wagb0gGJdQc8cWzHf mXN0sN3cIwQZkTtKR17DKYE46CEV8RQ= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RH7Hn5zBSztRjZ; Fri, 4 Aug 2023 09:22:45 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 4 Aug 2023 09:26:08 +0800 From: Peng Zhang To: CC: , , , ZhangPeng Subject: [PATCH 5/7] mm/nommu.c: use helper macro K() Date: Fri, 4 Aug 2023 09:25:57 +0800 Message-ID: <20230804012559.2617515-6-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230804012559.2617515-1-zhangpeng362@huawei.com> References: <20230804012559.2617515-1-zhangpeng362@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 5CBB9A0015 X-Rspam-User: X-Stat-Signature: aurmac1oupgo8ago3pdasygj88q7nxuo X-Rspamd-Server: rspam03 X-HE-Tag: 1691112371-363174 X-HE-Meta: U2FsdGVkX1+W9It1ja4PX+KzJJvFWkhooM2Up0uQ5oc3MsLgUiYNHn/UsRRQf4AsfgE0iZ4B4pcaB1wfMjOAOiS/vxhVcv19UpfnYeJWggfXl9CbzhKUGnVSKft6BLzS+9z82Li2ussH48J2w1qD62s5lXChSP196dPRjGXJq3E3EZ1azHtIGsqZi/ZD5igq6rOf3qjkOqhSF4PiF2gHwHjc4Yx/kfOQgq/MjgtzyIkhqcO2jqzVtv4asqL5f8AfC5XQhyJi3Q2hQu0+arxmRJmoIrNgtvsqXOmDEfB7EYFTpIMU01Azvu5tVxUuxmgsEx4mZrl0AEx/z/05mdSr02YiFeWUd40g+X1vDqpMfrScLjnYwpdktBf9UgNtKWmcboKBGb17KX2NIi7LrHYboKwf/pIQm48RRfvQ/ByhX9pBiEYPH2iStVB5Rr2gqXFUs8MmS5Qa1C6KdLaJtz9WjywOog3U9rOoUo9MdPl4xtLXd1LVUSAAeYcPRrURNhaVW43FMHX1IYWRfYQJj/W7Lj8mB93VOVyFBMW0V6YaZRzJcOUja/Usdn1/tkRlwMt48wqXCeJ37VhO0M0uGtPFlwPWSXX7u3toM+tuxSBFF72t+ec9XcQEpSYN828Mz8PfUS/63pgVDHBlq04p62CR6XJLos3bwsTnCq/4vOhPKocafBcz2WshCrKSscqXdBJliaeQHFq9/M6nRPZ4ZC0RLIezOePcx1fkPOqHbME6sku+3p209vXmK1V4h0z05T9zzi5I4+AQLTLuW0KQY/lZSyHStEkv18pASI2FxOhY7bkhv+KjWISBEE1ecEH8z5irNqcf8gHUeMUMqZKPvZB9bIyaDlx3Svu/VETEbXr32S/JYWitGfDmc06u4hzMDi+GEUbmKCwXsZWj1JiA02eMwuBasuwWrK1ElSjbQgM7HlYkOeIkQo6KPcyorSxuh/DeBgAnVTHxIQ/CyL/RPch 1gNNjLYf 0cuIb4Ys2ezUssiBoc4eLs5ZMI3bWOOBEv4fUje4YGbw1qVslTs2OVopQSJJoICFQjs7uRSuFrNk7kQjO0bx8Gt0s7RzOmfmZ02+EPRs/ZxpzhWR1U+jEryzaAmxHATnl3MhP1GoIOVqKJFG6AvzQ7LcUQQ== 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: ZhangPeng Use helper macro K() to improve code readability. No functional modification involved. Signed-off-by: ZhangPeng Reviewed-by: David Hildenbrand --- mm/nommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/nommu.c b/mm/nommu.c index 1fe0ee239860..8dba41cfc44d 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -1800,7 +1800,7 @@ static int __meminit init_user_reserve(void) { unsigned long free_kbytes; - free_kbytes = global_zone_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10); + free_kbytes = K(global_zone_page_state(NR_FREE_PAGES)); sysctl_user_reserve_kbytes = min(free_kbytes / 32, 1UL << 17); return 0; @@ -1821,7 +1821,7 @@ static int __meminit init_admin_reserve(void) { unsigned long free_kbytes; - free_kbytes = global_zone_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10); + free_kbytes = K(global_zone_page_state(NR_FREE_PAGES)); sysctl_admin_reserve_kbytes = min(free_kbytes / 32, 1UL << 13); return 0;