From patchwork Thu Aug 3 11:40:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13339854 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 BC1E2C001DF for ; Thu, 3 Aug 2023 11:41:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A13B280238; Thu, 3 Aug 2023 07:41:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4517F28022C; Thu, 3 Aug 2023 07:41:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 33FF4280238; Thu, 3 Aug 2023 07:41:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 255A328022C for ; Thu, 3 Aug 2023 07:41:14 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id DE48A40EF2 for ; Thu, 3 Aug 2023 11:41:13 +0000 (UTC) X-FDA: 81082602426.20.5D4E5B2 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf12.hostedemail.com (Postfix) with ESMTP id B59214000C for ; Thu, 3 Aug 2023 11:41:10 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf12.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691062872; 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: references; bh=SXAPUA2SeVic5O+tkGG4D1GMu53/vPL4YJbs3Gax6jM=; b=nz6f0yygyKM3shj5VlPQI2wGoAcshVcMh3tACEn5aw6DqMY1nndtcS+eP+gaIW/e3p2eZy oxYRhJLpB+iyK3DHGaz6AVEHWg3IrUzskzwmeyXm7XIoKjT3QEL8ChKprPzXzI4zlMj/pV 0tmrSewhxXR9L1tCPBeZRVRKuh2EpVc= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf12.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691062872; a=rsa-sha256; cv=none; b=LuTk+I0+t8NBLgCMD7K96F+wHfMOrPx8H+XKCL0J79gBxbMIPhhLjUgnlFUqyfL26VAHZz Y6W+PsEd3U+D53Jes+r0puwNaZH9+Qb0dJMrgcqXv7fvVpFTaJq6SjrJDFK0lxuFN06VD+ e/kp0FZM0QrqZns96IY0IQ/LRi2sz68= Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RGmzm1MWvzNmhL; Thu, 3 Aug 2023 19:37:40 +0800 (CST) Received: from huawei.com (10.174.151.185) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 3 Aug 2023 19:41:05 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH] mm/mm_init: use helper macro BITS_PER_LONG Date: Thu, 3 Aug 2023 19:40:51 +0800 Message-ID: <20230803114051.637709-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: B59214000C X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 6zzbwoj53qoxuejfir6j7x6hr61qn645 X-HE-Tag: 1691062870-84223 X-HE-Meta: U2FsdGVkX195JdVci9oYAKhMXgMa+N8AcTXi6VCzfThtkTSVAiLtYvpmXwPsAW0KipFrKXjY9ekaL8BLGm3Ge/Zgu5+J2QVVhUf5Ab2ZD8y0mHWHZlx1qmRLr+6032xhi5D43FwDRcbHxIrdEp8yfDuWulOaEvcu5H6+nK68/oEQJbbmBFDejJbf37CbF69gyCh7+KqYpaJj9Y/8kxke6uijWFTGLIqxg1TTFCHcsSxEFaXFV9wf7lhS4t4IVKxtIyQVsvCPdL8JluiFhc3YomeKOwYnwoXtGW8W1CarZbXZdb4Yy2jEBHjjDhwDNWHXLtrzx39u4K32gFM4pBUNCpyjKTzHep3k8ptyo1c9XRpbqwC2uriTmS8KCM01/KS3cNNxfBtUcjpPmohO/Pq8AJvtp1Rit57GJy69fUjxORdX8LxiHUcQsVujj+Oj0aCnqZyoW92eTHeY2uIwUHUqroxdWiDDZG8PJ9BCfLUSr0ZcURlULrp1ZQ+fTL9fnTHMiS9hFh+uQS6vEExLYVvm0S6WebrAsYy5oDoNX7ls1Pzkl7uqXqXb7xkmuCb4+LoRO7kj3Jv63s4kpMlVguu0TeaSX+T2peN9HasSyCUL1CcAO+4Ezo/nczpoU7vkF6QG7j6WEFCHIP2iA+w1UXzyrmu9lIy04liTVkRIrVAN6+UMMz/clbmtx/mVBgt0OGpdIajGj6LnVejJG5x567q4Nox0ZTiBV6WdHZNBp/B8MKF4pix3832cIsUzuwod+mHS+CMU2QHYAxmUt0EKnSEOy0ziXoQXhIDhmN4VCYFX5fMEzOr6dtzAmuqREuHqkwGW6rgFWeLuFMokv7H5rl1Bcb14BOZslfCeZVgWKnxG06Ot9rTlSwDH3hZgUxm58ywP3AR7B72LimIfYiEDDIkRt+VGFmH01/6OL7ffkHk8e+ChbHjP/vUGYJlFIzxnwRwQ6CP7F/dFtLkXPMNtIhc l7fHLq5h NAqMmcAM0Jev0lO2Ki0yJNiGu2rYruW45iRmqkED1Lbw1mitFbklklnqLglfvDNKKfPdatRp7MN17UrE5x5z1r2L1fiMd/8PI7E91mF66jTSTrmeAnbM4ua4sGtdILmkBsooYtxqfM0ENyik7RTz+wQCT0DcnBpBNmGsGgCk5KW5pydEKNzzwAwc2p3YdIwkQIzgS 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: It's more readable to use helper macro BITS_PER_LONG. No functional change intended. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand --- mm/mm_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/mm_init.c b/mm/mm_init.c index 66aca3f6accd..2f37dbb5ff9a 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -79,7 +79,7 @@ void __init mminit_verify_pageflags_layout(void) int shift, width; unsigned long or_mask, add_mask; - shift = 8 * sizeof(unsigned long); + shift = BITS_PER_LONG; width = shift - SECTIONS_WIDTH - NODES_WIDTH - ZONES_WIDTH - LAST_CPUPID_SHIFT - KASAN_TAG_WIDTH - LRU_GEN_WIDTH - LRU_REFS_WIDTH; mminit_dprintk(MMINIT_TRACE, "pageflags_layout_widths", @@ -1431,7 +1431,7 @@ static unsigned long __init usemap_size(unsigned long zone_start_pfn, unsigned l usemapsize = roundup(zonesize, pageblock_nr_pages); usemapsize = usemapsize >> pageblock_order; usemapsize *= NR_PAGEBLOCK_BITS; - usemapsize = roundup(usemapsize, 8 * sizeof(unsigned long)); + usemapsize = roundup(usemapsize, BITS_PER_LONG); return usemapsize / 8; }