diff mbox series

[7/7] mm/hugetlb.c: use helper macro K()

Message ID 20230804012559.2617515-8-zhangpeng362@huawei.com (mailing list archive)
State New
Headers show
Series cleanup with helper macro K() | expand

Commit Message

Peng Zhang Aug. 4, 2023, 1:25 a.m. UTC
From: ZhangPeng <zhangpeng362@huawei.com>

Use helper macro K() to improve code readability. No functional
modification involved.

Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
---
 mm/hugetlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Hildenbrand Aug. 7, 2023, 3:20 p.m. UTC | #1
On 04.08.23 03:25, Peng Zhang wrote:
> From: ZhangPeng <zhangpeng362@huawei.com>
> 
> Use helper macro K() to improve code readability. No functional
> modification involved.
> 
> Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
> ---
>   mm/hugetlb.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index e327a5a7602c..941d1d497b65 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -4775,7 +4775,7 @@ void hugetlb_show_meminfo_node(int nid)
>   void hugetlb_report_usage(struct seq_file *m, struct mm_struct *mm)
>   {
>   	seq_printf(m, "HugetlbPages:\t%8lu kB\n",
> -		   atomic_long_read(&mm->hugetlb_usage) << (PAGE_SHIFT - 10));
> +		   K(atomic_long_read(&mm->hugetlb_usage)));
>   }
>   
>   /* Return the number pages of memory we physically have, in PAGE_SIZE units. */

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index e327a5a7602c..941d1d497b65 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4775,7 +4775,7 @@  void hugetlb_show_meminfo_node(int nid)
 void hugetlb_report_usage(struct seq_file *m, struct mm_struct *mm)
 {
 	seq_printf(m, "HugetlbPages:\t%8lu kB\n",
-		   atomic_long_read(&mm->hugetlb_usage) << (PAGE_SHIFT - 10));
+		   K(atomic_long_read(&mm->hugetlb_usage)));
 }
 
 /* Return the number pages of memory we physically have, in PAGE_SIZE units. */