From patchwork Tue Jul 26 14:29: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: 12929374 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 A2726C04A68 for ; Tue, 26 Jul 2022 14:29:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA6D58E0003; Tue, 26 Jul 2022 10:29:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C56828E0001; Tue, 26 Jul 2022 10:29:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1DF48E0002; Tue, 26 Jul 2022 10:29:40 -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 A2F558E0001 for ; Tue, 26 Jul 2022 10:29:40 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 7348080964 for ; Tue, 26 Jul 2022 14:29:40 +0000 (UTC) X-FDA: 79729484520.11.47B2A02 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf11.hostedemail.com (Postfix) with ESMTP id AE6E1400CE for ; Tue, 26 Jul 2022 14:29:38 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LsfPK0MTJzkXVQ; Tue, 26 Jul 2022 22:27:01 +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; Tue, 26 Jul 2022 22:29:32 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH v2 1/5] hugetlbfs: use helper macro SZ_1{K,M} Date: Tue, 26 Jul 2022 22:29:14 +0800 Message-ID: <20220726142918.51693-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220726142918.51693-1-linmiaohe@huawei.com> References: <20220726142918.51693-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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658845779; a=rsa-sha256; cv=none; b=nCJUJrQNlkCKzy7u3P/TJfZDGV3ch+o724uaHW1p0AyfSEivMtNQK4OpFiFnICRUHmlZ3p bSo50qvx/2KYgHFP9c41bqBOXwFBr0rDj67rIE4NLEQTO9bwNHiHnaJ5JYChoonj/U9mH8 lyUlRARbeuSS/4Y35s0NZi3sjuB4WUs= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 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=1658845779; 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=K4kSvTZU7GPnRaqm3y8kLJYKpC0PjKD7ApYev4Q/uOE=; b=WyK9izrLaDo0bHzqVTfDAluB9cMfMT8Cw91uIck0JhiyXkLER1vaDHIScKz+NgXujTbzpp 56wM5Xhu4MAVTOVvC8IWJl6tNrQwjndoBThlLA4dR//p+T6unJfGtyF8wQZBFpFWRalSm3 cl7/AGAom8D6WXJ5PtXrP91kOMbC2q0= X-Stat-Signature: ia3r37aysqsqnpfwpjmgfy389br1k9mz X-Rspamd-Queue-Id: AE6E1400CE X-Rspamd-Server: rspam08 X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1658845778-529563 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 and SZ_1M to do the size conversion. Minor readability improvement. Signed-off-by: Miaohe Lin Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song --- fs/hugetlbfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 20336cb3c040..e998c416b85f 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -1309,7 +1309,7 @@ static int hugetlbfs_parse_param(struct fs_context *fc, struct fs_parameter *par ps = memparse(param->string, &rest); ctx->hstate = size_to_hstate(ps); if (!ctx->hstate) { - pr_err("Unsupported page size %lu MB\n", ps >> 20); + pr_err("Unsupported page size %lu MB\n", ps / SZ_1M); return -EINVAL; } return 0; @@ -1555,7 +1555,7 @@ static struct vfsmount *__init mount_one_hugetlbfs(struct hstate *h) } if (IS_ERR(mnt)) pr_err("Cannot mount internal hugetlbfs for page size %luK", - huge_page_size(h) >> 10); + huge_page_size(h) / SZ_1K); return mnt; }