提交 d0036517 编写于 作者: M Miaohe Lin 提交者: akpm

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.comSigned-off-by: NMiaohe Lin <linmiaohe@huawei.com>
Reviewed-by: NMike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: NMuchun Song <songmuchun@bytedance.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
上级 bb077c3f
...@@ -1320,7 +1320,7 @@ static int hugetlbfs_parse_param(struct fs_context *fc, struct fs_parameter *par ...@@ -1320,7 +1320,7 @@ static int hugetlbfs_parse_param(struct fs_context *fc, struct fs_parameter *par
ps = memparse(param->string, &rest); ps = memparse(param->string, &rest);
ctx->hstate = size_to_hstate(ps); ctx->hstate = size_to_hstate(ps);
if (!ctx->hstate) { 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 -EINVAL;
} }
return 0; return 0;
...@@ -1566,7 +1566,7 @@ static struct vfsmount *__init mount_one_hugetlbfs(struct hstate *h) ...@@ -1566,7 +1566,7 @@ static struct vfsmount *__init mount_one_hugetlbfs(struct hstate *h)
} }
if (IS_ERR(mnt)) if (IS_ERR(mnt))
pr_err("Cannot mount internal hugetlbfs for page size %luK", pr_err("Cannot mount internal hugetlbfs for page size %luK",
huge_page_size(h) >> 10); huge_page_size(h) / SZ_1K);
return mnt; return mnt;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册