2023-11-06 08:29:45

by zhaimingbing

[permalink] [raw]
Subject: [PATCH] mm:hugetlb_cgroup: Fix the wrong format specifier

The long type should use "%ld" instead of "%lu".

Signed-off-by: zhaimingbing <[email protected]>
---
mm/hugetlb_cgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index dedd2edb0..3c132795c 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -696,7 +696,7 @@ static int __hugetlb_events_show(struct seq_file *seq, bool local)
else
max = atomic_long_read(&h_cg->events[idx][HUGETLB_MAX]);

- seq_printf(seq, "max %lu\n", max);
+ seq_printf(seq, "max %ld\n", max);

return 0;
}
--
2.33.0




2023-11-06 20:41:16

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH] mm:hugetlb_cgroup: Fix the wrong format specifier



On 11/6/23 00:27, zhaimingbing wrote:
> The long type should use "%ld" instead of "%lu".
>
> Signed-off-by: zhaimingbing <[email protected]>

Acked-by: Randy Dunlap <[email protected]>

Thanks.

> ---
> mm/hugetlb_cgroup.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
> index dedd2edb0..3c132795c 100644
> --- a/mm/hugetlb_cgroup.c
> +++ b/mm/hugetlb_cgroup.c
> @@ -696,7 +696,7 @@ static int __hugetlb_events_show(struct seq_file *seq, bool local)
> else
> max = atomic_long_read(&h_cg->events[idx][HUGETLB_MAX]);
>
> - seq_printf(seq, "max %lu\n", max);
> + seq_printf(seq, "max %ld\n", max);
>
> return 0;
> }

--
~Randy