* [PATCH] tools/mm: fix show_page() build error
@ 2024-11-14 10:01 Oleksandr Natalenko
2024-11-14 19:02 ` SeongJae Park
0 siblings, 1 reply; 3+ messages in thread
From: Oleksandr Natalenko @ 2024-11-14 10:01 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-mm, Andrew Morton, Wladislav Wiebe
At one point I needed mm tools for debugging but couldn't compile them due to the
following error:
gcc -Wall -Wextra -I../lib/ -pthread -o page-types page-types.c ../lib/api/libapi.a -pthread
page-types.c: In function ‘show_page’:
page-types.c:423:49: error: expected ‘;’ before ‘if’
423 | printf("@%" PRIu64 "\t", cgroup)
| ^
| ;
424 | if (opt_list_mapcnt)
| ~~
page-types.c:416:65: warning: unused parameter ‘mapcnt’ [-Wunused-parameter]
416 | uint64_t flags, uint64_t cgroup, uint64_t mapcnt)
| ~~~~~~~~~^~~~~~
make: *** [Makefile:23: page-types] Error 1
Trailing ; was forgotten, so add it.
Fixes: ece5897e5a10 ("tools/mm: -Werror fixes in page-types/slabinfo")
Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
---
tools/mm/page-types.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/mm/page-types.c b/tools/mm/page-types.c
index 6eb17cc1a06c5..bcac7ebfb51fd 100644
--- a/tools/mm/page-types.c
+++ b/tools/mm/page-types.c
@@ -420,7 +420,7 @@ static void show_page(unsigned long voffset, unsigned long offset,
if (opt_file)
printf("%lx\t", voffset);
if (opt_list_cgroup)
- printf("@%" PRIu64 "\t", cgroup)
+ printf("@%" PRIu64 "\t", cgroup);
if (opt_list_mapcnt)
printf("%" PRIu64 "\t", mapcnt);
--
2.47.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] tools/mm: fix show_page() build error
2024-11-14 10:01 [PATCH] tools/mm: fix show_page() build error Oleksandr Natalenko
@ 2024-11-14 19:02 ` SeongJae Park
2024-11-14 20:03 ` Oleksandr Natalenko
0 siblings, 1 reply; 3+ messages in thread
From: SeongJae Park @ 2024-11-14 19:02 UTC (permalink / raw)
To: Oleksandr Natalenko
Cc: SeongJae Park, linux-kernel, linux-mm, Andrew Morton,
Wladislav Wiebe, motiejus, vishal.moola
Hi Oleksandr,
On Thu, 14 Nov 2024 11:01:40 +0100 Oleksandr Natalenko <oleksandr@natalenko.name> wrote:
> At one point I needed mm tools for debugging but couldn't compile them due to the
> following error:
>
> gcc -Wall -Wextra -I../lib/ -pthread -o page-types page-types.c ../lib/api/libapi.a -pthread
> page-types.c: In function \u2018show_page\u2019:
> page-types.c:423:49: error: expected \u2018;\u2019 before \u2018if\u2019
> 423 | printf("@%" PRIu64 "\t", cgroup)
> | ^
> | ;
> 424 | if (opt_list_mapcnt)
> | ~~
> page-types.c:416:65: warning: unused parameter \u2018mapcnt\u2019 [-Wunused-parameter]
> 416 | uint64_t flags, uint64_t cgroup, uint64_t mapcnt)
> | ~~~~~~~~~^~~~~~
> make: *** [Makefile:23: page-types] Error 1
>
> Trailing ; was forgotten, so add it.
>
> Fixes: ece5897e5a10 ("tools/mm: -Werror fixes in page-types/slabinfo")
> Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
> ---
> tools/mm/page-types.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/mm/page-types.c b/tools/mm/page-types.c
> index 6eb17cc1a06c5..bcac7ebfb51fd 100644
> --- a/tools/mm/page-types.c
> +++ b/tools/mm/page-types.c
> @@ -420,7 +420,7 @@ static void show_page(unsigned long voffset, unsigned long offset,
> if (opt_file)
> printf("%lx\t", voffset);
> if (opt_list_cgroup)
> - printf("@%" PRIu64 "\t", cgroup)
> + printf("@%" PRIu64 "\t", cgroup);
> if (opt_list_mapcnt)
> printf("%" PRIu64 "\t", mapcnt);
>
> --
> 2.47.0
Just FYI, a very similar patch has posted a few days ago:
https://lore.kernel.org/20241112171655.1662670-1-motiejus@jakstys.lt
Thanks,
SJ
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] tools/mm: fix show_page() build error
2024-11-14 19:02 ` SeongJae Park
@ 2024-11-14 20:03 ` Oleksandr Natalenko
0 siblings, 0 replies; 3+ messages in thread
From: Oleksandr Natalenko @ 2024-11-14 20:03 UTC (permalink / raw)
To: SeongJae Park, linux-kernel
Cc: linux-mm, Andrew Morton, Wladislav Wiebe, motiejus, vishal.moola
[-- Attachment #1: Type: text/plain, Size: 2173 bytes --]
Hello.
On čtvrtek 14. listopadu 2024 20:02:04, středoevropský standardní čas SeongJae Park wrote:
> On Thu, 14 Nov 2024 11:01:40 +0100 Oleksandr Natalenko <oleksandr@natalenko.name> wrote:
>
> > At one point I needed mm tools for debugging but couldn't compile them due to the
> > following error:
> >
> > gcc -Wall -Wextra -I../lib/ -pthread -o page-types page-types.c ../lib/api/libapi.a -pthread
> > page-types.c: In function \u2018show_page\u2019:
> > page-types.c:423:49: error: expected \u2018;\u2019 before \u2018if\u2019
> > 423 | printf("@%" PRIu64 "\t", cgroup)
> > | ^
> > | ;
> > 424 | if (opt_list_mapcnt)
> > | ~~
> > page-types.c:416:65: warning: unused parameter \u2018mapcnt\u2019 [-Wunused-parameter]
> > 416 | uint64_t flags, uint64_t cgroup, uint64_t mapcnt)
> > | ~~~~~~~~~^~~~~~
> > make: *** [Makefile:23: page-types] Error 1
> >
> > Trailing ; was forgotten, so add it.
> >
> > Fixes: ece5897e5a10 ("tools/mm: -Werror fixes in page-types/slabinfo")
> > Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
> > ---
> > tools/mm/page-types.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/mm/page-types.c b/tools/mm/page-types.c
> > index 6eb17cc1a06c5..bcac7ebfb51fd 100644
> > --- a/tools/mm/page-types.c
> > +++ b/tools/mm/page-types.c
> > @@ -420,7 +420,7 @@ static void show_page(unsigned long voffset, unsigned long offset,
> > if (opt_file)
> > printf("%lx\t", voffset);
> > if (opt_list_cgroup)
> > - printf("@%" PRIu64 "\t", cgroup)
> > + printf("@%" PRIu64 "\t", cgroup);
> > if (opt_list_mapcnt)
> > printf("%" PRIu64 "\t", mapcnt);
> >
>
> Just FYI, a very similar patch has posted a few days ago:
> https://lore.kernel.org/20241112171655.1662670-1-motiejus@jakstys.lt
OK, if the other one is taken, consider adding my Acked-by: then.
Thank you.
--
Oleksandr Natalenko, MSE
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-14 20:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-14 10:01 [PATCH] tools/mm: fix show_page() build error Oleksandr Natalenko
2024-11-14 19:02 ` SeongJae Park
2024-11-14 20:03 ` Oleksandr Natalenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox