mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 14:12:06 +00:00
kcsan: Fix printk format string
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.
Fixes: f6a1491403
("kcsan: Switch to KUNIT_CASE_PARAM for parameterized tests")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Marco Elver <elver@google.com>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Link: https://lkml.kernel.org/r/20210421135059.3371701-1-arnd@kernel.org
This commit is contained in:
parent
c9450f728c
commit
f4abe9967c
@ -984,7 +984,7 @@ static const void *nthreads_gen_params(const void *prev, char *desc)
|
|||||||
const long min_required_cpus = 2 + min_unused_cpus;
|
const long min_required_cpus = 2 + min_unused_cpus;
|
||||||
|
|
||||||
if (num_online_cpus() < min_required_cpus) {
|
if (num_online_cpus() < min_required_cpus) {
|
||||||
pr_err_once("Too few online CPUs (%u < %d) for test\n",
|
pr_err_once("Too few online CPUs (%u < %ld) for test\n",
|
||||||
num_online_cpus(), min_required_cpus);
|
num_online_cpus(), min_required_cpus);
|
||||||
nthreads = 0;
|
nthreads = 0;
|
||||||
} else if (nthreads >= num_online_cpus() - min_unused_cpus) {
|
} else if (nthreads >= num_online_cpus() - min_unused_cpus) {
|
||||||
|
Loading…
Reference in New Issue
Block a user