Skip to content

Commit 613b432

Browse files
committed
perf tools: fix type mismatch - long vs __statfs_word
From "include/uapi/asm-generic/statfs.h" it is seen that "statfs.f_type" is of type "__statfs_word" which in its turn is "__u32" (unsigned int) for 32-bit systems. So in case of compilation with "-Werror" following breakage happens: --->--- fs.c: In function ‘fs__valid_mount’: fs.c:76:24: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] else if (st_fs.f_type != magic) ^ cc1: all warnings being treated as errors --->--- Note that now when fs.c is in "lib/api/fs" and in "tools/lib/api/Makefile" CFLAGS has hard-coded "-Werror" this is inevitable even if obe builds "perf" with "WERROR=0". Signed-off-by: Alexey Brodkin <[email protected]> Cc: Vineet Gupta <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Jiri Olsa <[email protected]>
1 parent 35032e7 commit 613b432

File tree

1 file changed

+1
-1
lines changed
  • tools/lib/api/fs

1 file changed

+1
-1
lines changed

tools/lib/api/fs/fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static int fs__valid_mount(const char *fs, long magic)
7373

7474
if (statfs(fs, &st_fs) < 0)
7575
return -ENOENT;
76-
else if (st_fs.f_type != magic)
76+
else if ((long)st_fs.f_type != magic)
7777
return -ENOENT;
7878

7979
return 0;

0 commit comments

Comments
 (0)