linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/hugetlbfs: use macro SZ_1K to replace 1024
@ 2022-09-14 11:57 Xin Hao
  2022-09-14 14:03 ` SeongJae Park
  2022-09-14 16:43 ` Al Viro
  0 siblings, 2 replies; 5+ messages in thread
From: Xin Hao @ 2022-09-14 11:57 UTC (permalink / raw)
  To: sj; +Cc: akpm, damon, linux-mm, linux-kernel, xhao

Using macro SZ_1K in hugetlbfs_show_options() has no any functional
changes, just makes code more readable.

Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
---
 fs/hugetlbfs/inode.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index f7a5b5124d8a..9b9784ffe8de 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -1023,10 +1023,10 @@ static int hugetlbfs_show_options(struct seq_file *m, struct dentry *root)
 	if (sbinfo->max_inodes != -1)
 		seq_printf(m, ",nr_inodes=%lu", sbinfo->max_inodes);

-	hpage_size /= 1024;
+	hpage_size /= SZ_1K;
 	mod = 'K';
-	if (hpage_size >= 1024) {
-		hpage_size /= 1024;
+	if (hpage_size >= SZ_1K) {
+		hpage_size /= SZ_1K;
 		mod = 'M';
 	}
 	seq_printf(m, ",pagesize=%lu%c", hpage_size, mod);
--
2.31.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-16 11:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14 11:57 [PATCH] mm/hugetlbfs: use macro SZ_1K to replace 1024 Xin Hao
2022-09-14 14:03 ` SeongJae Park
2022-09-14 16:43 ` Al Viro
2022-09-15  2:44   ` haoxin
2022-09-16 11:47     ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox