Skip to content

Commit d003651

Browse files
MiaoheLinakpm00
authored andcommitted
hugetlbfs: use helper macro SZ_1{K,M}
Patch series "A few cleanup and fixup patches for hugetlbfs", v2. This series contains a few cleaup patches to remove unneeded forward declaration, use helper macro and so on. More details can be found in the respective changelogs. This patch (of 5): Use helper macro SZ_1K and SZ_1M to do the size conversion. Minor readability improvement. Link: https://lkml.kernel.org/r/20220726142918.51693-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220726142918.51693-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com> Reviewed-by: Muchun Song <songmuchun@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent bb077c3 commit d003651

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/hugetlbfs/inode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ static int hugetlbfs_parse_param(struct fs_context *fc, struct fs_parameter *par
13201320
ps = memparse(param->string, &rest);
13211321
ctx->hstate = size_to_hstate(ps);
13221322
if (!ctx->hstate) {
1323-
pr_err("Unsupported page size %lu MB\n", ps >> 20);
1323+
pr_err("Unsupported page size %lu MB\n", ps / SZ_1M);
13241324
return -EINVAL;
13251325
}
13261326
return 0;
@@ -1566,7 +1566,7 @@ static struct vfsmount *__init mount_one_hugetlbfs(struct hstate *h)
15661566
}
15671567
if (IS_ERR(mnt))
15681568
pr_err("Cannot mount internal hugetlbfs for page size %luK",
1569-
huge_page_size(h) >> 10);
1569+
huge_page_size(h) / SZ_1K);
15701570
return mnt;
15711571
}
15721572

0 commit comments

Comments
 (0)