diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c index bfbb6b5f609cd0427bf3f7531143771e2c4f4248..da04b8c5568a39cf509b9aa5df844641866bcfd1 100644 --- a/tools/perf/bench/futex-hash.c +++ b/tools/perf/bench/futex-hash.c @@ -130,8 +130,6 @@ int bench_futex_hash(int argc, const char **argv, } ncpus = sysconf(_SC_NPROCESSORS_ONLN); - nsecs = futexbench_sanitize_numeric(nsecs); - nfutexes = futexbench_sanitize_numeric(nfutexes); sigfillset(&act.sa_mask); act.sa_sigaction = toggle_done; @@ -139,8 +137,6 @@ int bench_futex_hash(int argc, const char **argv, if (!nthreads) /* default to the number of CPUs */ nthreads = ncpus; - else - nthreads = futexbench_sanitize_numeric(nthreads); worker = calloc(nthreads, sizeof(*worker)); if (!worker) diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c index 6d9d6c40a9164442ce2d0c8a9cdd8831cd4a6297..91877777ec6e3a4052e49eca9cba4793fa551f73 100644 --- a/tools/perf/bench/futex-lock-pi.c +++ b/tools/perf/bench/futex-lock-pi.c @@ -152,7 +152,6 @@ int bench_futex_lock_pi(int argc, const char **argv, goto err; ncpus = sysconf(_SC_NPROCESSORS_ONLN); - nsecs = futexbench_sanitize_numeric(nsecs); sigfillset(&act.sa_mask); act.sa_sigaction = toggle_done; @@ -160,8 +159,6 @@ int bench_futex_lock_pi(int argc, const char **argv, if (!nthreads) nthreads = ncpus; - else - nthreads = futexbench_sanitize_numeric(nthreads); worker = calloc(nthreads, sizeof(*worker)); if (!worker) diff --git a/tools/perf/bench/futex-requeue.c b/tools/perf/bench/futex-requeue.c index fd4ee95b689a11c4646c33fdd07a1c202cc50958..2b9705a8734cd6005fd3149943e2ff20eecf4bbe 100644 --- a/tools/perf/bench/futex-requeue.c +++ b/tools/perf/bench/futex-requeue.c @@ -128,8 +128,6 @@ int bench_futex_requeue(int argc, const char **argv, if (!nthreads) nthreads = ncpus; - else - nthreads = futexbench_sanitize_numeric(nthreads); worker = calloc(nthreads, sizeof(*worker)); if (!worker) diff --git a/tools/perf/bench/futex-wake-parallel.c b/tools/perf/bench/futex-wake-parallel.c index beaa6c142477b5d500c9c83d12dadc242420e497..2c8fa67ad53767e43c7e91dc84279528268fcb3a 100644 --- a/tools/perf/bench/futex-wake-parallel.c +++ b/tools/perf/bench/futex-wake-parallel.c @@ -217,12 +217,8 @@ int bench_futex_wake_parallel(int argc, const char **argv, sigaction(SIGINT, &act, NULL); ncpus = sysconf(_SC_NPROCESSORS_ONLN); - nwaking_threads = futexbench_sanitize_numeric(nwaking_threads); - if (!nblocked_threads) nblocked_threads = ncpus; - else - nblocked_threads = futexbench_sanitize_numeric(nblocked_threads); /* some sanity checks */ if (nwaking_threads > nblocked_threads || !nwaking_threads) diff --git a/tools/perf/bench/futex-wake.c b/tools/perf/bench/futex-wake.c index 46efcb98b5a4be7041678712ed29d8c69ca3ab3c..e246b1b8388a3fd3bfc7c9c398a90efc26d86c79 100644 --- a/tools/perf/bench/futex-wake.c +++ b/tools/perf/bench/futex-wake.c @@ -129,7 +129,6 @@ int bench_futex_wake(int argc, const char **argv, } ncpus = sysconf(_SC_NPROCESSORS_ONLN); - nwakes = futexbench_sanitize_numeric(nwakes); sigfillset(&act.sa_mask); act.sa_sigaction = toggle_done; @@ -137,8 +136,6 @@ int bench_futex_wake(int argc, const char **argv, if (!nthreads) nthreads = ncpus; - else - nthreads = futexbench_sanitize_numeric(nthreads); worker = calloc(nthreads, sizeof(*worker)); if (!worker) diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h index ba7c735c0c62db090a2c1fddd9aec54876496cfe..b2e06d1190d0766694c97f7f0b808717442af604 100644 --- a/tools/perf/bench/futex.h +++ b/tools/perf/bench/futex.h @@ -7,7 +7,6 @@ #ifndef _FUTEX_H #define _FUTEX_H -#include #include #include #include @@ -100,7 +99,4 @@ static inline int pthread_attr_setaffinity_np(pthread_attr_t *attr, } #endif -/* User input sanitation */ -#define futexbench_sanitize_numeric(__n) abs((__n)) - #endif /* _FUTEX_H */