Message ID | 20220721131637.6306-2-linmiaohe@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | A few cleanup and fixup patches for hugetlbfs | expand |
On 07/21/22 21:16, Miaohe Lin wrote: > Use helper macro SZ_1K and SZ_1M to do the size conversion. Minor > readability improvement. > > Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> > --- > fs/hugetlbfs/inode.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Thanks, Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
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; }
Use helper macro SZ_1K and SZ_1M to do the size conversion. Minor readability improvement. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> --- fs/hugetlbfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)