Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: cachestat: use proper syscall number macro

At the moment the cachestat syscall number is hard coded into the test
source code.
Remove that and replace it with the proper __NR_cachestat macro.
That ensures compatibility should other architectures pick a different
number.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Nhat Pham <nphamcs@gmail.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Andre Przywara and committed by
Shuah Khan
9b1db732 7fb10233

+3 -4
+3 -4
tools/testing/selftests/cachestat/test_cachestat.c
··· 19 19 "/dev/zero", "/dev/null", "/dev/urandom", 20 20 "/proc/version", "/proc" 21 21 }; 22 - static const int cachestat_nr = 451; 23 22 24 23 void print_cachestat(struct cachestat *cs) 25 24 { ··· 125 126 } 126 127 } 127 128 128 - syscall_ret = syscall(cachestat_nr, fd, &cs_range, &cs, 0); 129 + syscall_ret = syscall(__NR_cachestat, fd, &cs_range, &cs, 0); 129 130 130 131 ksft_print_msg("Cachestat call returned %ld\n", syscall_ret); 131 132 ··· 151 152 ksft_print_msg("fsync fails.\n"); 152 153 ret = false; 153 154 } else { 154 - syscall_ret = syscall(cachestat_nr, fd, &cs_range, &cs, 0); 155 + syscall_ret = syscall(__NR_cachestat, fd, &cs_range, &cs, 0); 155 156 156 157 ksft_print_msg("Cachestat call (after fsync) returned %ld\n", 157 158 syscall_ret); ··· 212 213 goto close_fd; 213 214 } 214 215 215 - syscall_ret = syscall(cachestat_nr, fd, &cs_range, &cs, 0); 216 + syscall_ret = syscall(__NR_cachestat, fd, &cs_range, &cs, 0); 216 217 217 218 if (syscall_ret) { 218 219 ksft_print_msg("Cachestat returned non-zero.\n");