From patchwork Fri Aug 26 09:24:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12955706 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 BA72AECAAD6 for ; Fri, 26 Aug 2022 09:24:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 73F8B6B0078; Fri, 26 Aug 2022 05:24:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5DDED6B007D; Fri, 26 Aug 2022 05:24:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3EFB66B0074; Fri, 26 Aug 2022 05:24:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 2ACB36B0075 for ; Fri, 26 Aug 2022 05:24:56 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 042801C64F6 for ; Fri, 26 Aug 2022 09:24:55 +0000 (UTC) X-FDA: 79841209392.09.CE2BC9C Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf12.hostedemail.com (Postfix) with ESMTP id 3E56B4001F for ; Fri, 26 Aug 2022 09:24:55 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MDZ8H3R0MzkWjK; Fri, 26 Aug 2022 17:21:19 +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; Fri, 26 Aug 2022 17:24:51 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH 02/10] hugetlb: Use helper macro SZ_1K Date: Fri, 26 Aug 2022 17:24:14 +0800 Message-ID: <20220826092422.39591-3-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220826092422.39591-1-linmiaohe@huawei.com> References: <20220826092422.39591-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661505895; a=rsa-sha256; cv=none; b=eh+vyGM+Mn06t5ZgK+DxI33G6rb7G+1YjIUDm6PffV6erla8LBdkeCiI1t2FV3r+TwhTbI Xe6c0g6rxCS4XjGalMOUbSfXWcPmZQ3piedBXT02qdyLuizyJAFk2pAv1XK5M8Y+fOHYcE qHl18DmHyJE38foP/DKXp0N0JNnaDg0= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661505895; 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=ZLKsEjT5ukyCF/Hpu+6tbpoTWWUzpg99p6NSaZMn8ng=; b=aUbDnG8PbDeskTJd7OYK99zSVZheyUWs4GROql7Mj8QamwGROcJvnuQrn2Nc+J/Zcs1oYu 4B5j9ifqr5gVJaTRmel8CXWx6jkgP6X8xZmV2qvIrDrY9ZBJ4eWaMbGi8g2XAzuBK6D/t0 /P9+okKEJy61pC8c5YfjMS3W8fiYMw8= X-Stat-Signature: b8qogdx3uc5398ik1or4wmuwwf51yoe4 X-Rspamd-Queue-Id: 3E56B4001F X-Rspam-User: X-Rspamd-Server: rspam06 Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.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-HE-Tag: 1661505895-665647 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 10d84abb1ca7..24f580ddf130 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; }