History

perf tools: Fix statfs.f_type data type mismatch build error with uclibc

ARC Linux uses the no legacy syscalls abi and corresponding uClibc headers statfs defines f_type to be U32 which causes perf build breakage http://git.uclibc.org/uClibc/tree/libc/sysdeps/linux/common-generic/bits/statfs.h ----------->8--------------- CC fs/fs.o fs/fs.c: In function 'fs__valid_mount': fs/fs.c:82: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 ----------->8---------------

Alexey Brodkin committed 11 years ago

Commit db1806e1 parent 25cd4802 files · +2 −2Browse files

Unified · Split

2 files
  1. tools/lib/api/fs/debugfs.c +1 −1
  2. tools/lib/api/fs/fs.c +1 −1
tools/lib/api/fs/debugfs.c+1−1
@@ -67,7 +67,7 @@ int debugfs_valid_mountpoint(const char *debugfs) · 66 unmodified lines
6767
6868 if (statfs(debugfs, &st_fs) < 0)
6969 return -ENOENT;
70− else if (st_fs.f_type != (long) DEBUGFS_MAGIC)
70+ else if ((long)st_fs.f_type != (long)DEBUGFS_MAGIC)
7171 return -ENOENT;
7272
7373 return 0;
tools/lib/api/fs/fs.c+1−1
@@ -79,7 +79,7 @@ static int fs__valid_mount(const char *fs, long magic) · 78 unmodified lines
7979
8080 if (statfs(fs, &st_fs) < 0)
8181 return -ENOENT;
82− else if (st_fs.f_type != magic)
82+ else if ((long)st_fs.f_type != magic)
8383 return -ENOENT;
8484
8585 return 0;