From patchwork Thu Sep 1 12:00:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12962361 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 3B34BECAAD3 for ; Thu, 1 Sep 2022 12:01:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EF7768D0008; Thu, 1 Sep 2022 08:01:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E7BD18D0003; Thu, 1 Sep 2022 08:01:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1CF78D0008; Thu, 1 Sep 2022 08:01:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B38268D0003 for ; Thu, 1 Sep 2022 08:01:09 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9383CA1029 for ; Thu, 1 Sep 2022 12:01:09 +0000 (UTC) X-FDA: 79863375858.07.B10079E Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf03.hostedemail.com (Postfix) with ESMTP id 88FED20063 for ; Thu, 1 Sep 2022 12:01:05 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MJKKY3NN6zkWTX; Thu, 1 Sep 2022 19:57:21 +0800 (CST) Received: from huawei.com (10.175.124.27) 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.2375.24; Thu, 1 Sep 2022 20:01:02 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH v2 02/10] hugetlb: Use helper macro SZ_1K Date: Thu, 1 Sep 2022 20:00:22 +0800 Message-ID: <20220901120030.63318-3-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220901120030.63318-1-linmiaohe@huawei.com> References: <20220901120030.63318-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662033665; 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=xcmegM78RyOPBi6hJlbnUA6x1pSNavTpOf3rXlq9SdA=; b=IB0Fo3J86pFbkq57y+vuLJxps5Bzkze2HDnCSMo3WZ8SilgI/1FgXxWuUoqfunfSgUvdVW 9//Kr7qs/4FuDvfXrHfs8NAdr+nLPX6vkbvqQ94RHK8tUR3zQgGDQIW+YcEO/4EVVUvQQR kaRIxtt0X2mrLZI8m6TkqcNL3miOutY= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662033665; a=rsa-sha256; cv=none; b=oxK/1kKxfgfBv0BQk7hPaOvpUui5YG71ZiZcEKP/oiMqsuW9pqNbVi2b5OXjlo0+6MdpQ6 OoLU1kS8WcbeCd4BL9jwFkV6m6XFs5jaqcxAwVbkAb6DsIzviTt5RSKtKkDdzsidxzkWDP SC72EAQmkJNz5dMIfTX1yl3CUxDb2QI= X-Stat-Signature: 988is7wpyezztnr9gbbiwgeuoc74e38n X-Rspamd-Queue-Id: 88FED20063 Authentication-Results: imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1662033665-221619 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: Use helper macro SZ_1K to do the size conversion to make code more consistent in this file. Minor readability improvement. Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song --- mm/hugetlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 2f5008c67624..0d63a7fda1d9 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4165,7 +4165,7 @@ void __init hugetlb_add_hstate(unsigned int order) h->next_nid_to_alloc = first_memory_node; h->next_nid_to_free = first_memory_node; snprintf(h->name, HSTATE_NAME_LEN, "hugepages-%lukB", - huge_page_size(h)/1024); + huge_page_size(h)/SZ_1K); parsed_hstate = h; }