summaryrefslogtreecommitdiffstats
path: root/tools/mm/slabinfo.c
diff options
context:
space:
mode:
authorWladislav Wiebe <wladislav.kw@gmail.com>2024-10-22 19:21:13 +0200
committerAndrew Morton <akpm@linux-foundation.org>2024-10-31 04:14:11 +0100
commitece5897e5a10fcd56a317e32f2dc7219f366a5a8 (patch)
tree4c4af8be96818682011cbdab00f975569fbcb211 /tools/mm/slabinfo.c
parentmm, swap: avoid over reclaim of full clusters (diff)
downloadlinux-ece5897e5a10fcd56a317e32f2dc7219f366a5a8.tar.xz
linux-ece5897e5a10fcd56a317e32f2dc7219f366a5a8.zip
tools/mm: -Werror fixes in page-types/slabinfo
Commit e6d2c436ff693 ("tools/mm: allow users to provide additional cflags/ldflags") passes now CFLAGS to Makefile. With this, build systems with default -Werror enabled found: slabinfo.c:1300:25: error: ignoring return value of 'chdir' declared with attribute 'warn_unused_result' [-Werror=unused-result]                          chdir("..");                          ^~~~~~~~~~~ page-types.c:397:35: error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'uint64_t' {aka 'long long unsigned int'} [-Werror=format=]                          printf("%lu\t", mapcnt0);                                  ~~^     ~~~~~~~ .. Fix page-types by using PRIu64 for uint64_t prints and check in slabinfo for return code on chdir(".."). Link: https://lkml.kernel.org/r/c1ceb507-94bc-461c-934d-c19b77edd825@gmail.com Fixes: e6d2c436ff69 ("tools/mm: allow users to provide additional cflags/ldflags") Signed-off-by: Wladislav Wiebe <wladislav.kw@gmail.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Herton R. Krzesinski <herton@redhat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--tools/mm/slabinfo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/mm/slabinfo.c b/tools/mm/slabinfo.c
index cfaeaea71042..04e9e6ba86ea 100644
--- a/tools/mm/slabinfo.c
+++ b/tools/mm/slabinfo.c
@@ -1297,7 +1297,9 @@ static void read_slab_dir(void)
slab->cpu_partial_free = get_obj("cpu_partial_free");
slab->alloc_node_mismatch = get_obj("alloc_node_mismatch");
slab->deactivate_bypass = get_obj("deactivate_bypass");
- chdir("..");
+ if (chdir(".."))
+ fatal("Unable to chdir from slab ../%s\n",
+ slab->name);
if (slab->name[0] == ':')
alias_targets++;
slab++;