Printing a 'long' variable using the '%d' format string is wrong and causes a warning from gcc: kernel/kcsan/kcsan_test.c: In function 'nthreads_gen_params': include/linux/kern_levels.h:5:25: error: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Werror=format=] Use the appropriate format modifier.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -984,7 +984,7 @@ static const void *nthreads_gen_params(const void *prev, char *desc) · 983 unmodified lines | |||
| 984 | const long min_required_cpus = 2 + min_unused_cpus; | 984 | const long min_required_cpus = 2 + min_unused_cpus; |
| 985 | 985 | ||
| 986 | if (num_online_cpus() < min_required_cpus) { | 986 | if (num_online_cpus() < min_required_cpus) { |
| 987 | pr_err_once("Too few online CPUs (%u < %d) for test\n", | 987 | pr_err_once("Too few online CPUs (%u < %ld) for test\n", |
| 988 | num_online_cpus(), min_required_cpus); | 988 | num_online_cpus(), min_required_cpus); |
| 989 | nthreads = 0; | 989 | nthreads = 0; |
| 990 | } else if (nthreads >= num_online_cpus() - min_unused_cpus) { | 990 | } else if (nthreads >= num_online_cpus() - min_unused_cpus) { |