History

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.

Arnd Bergmann committed 5 years ago

Commit f4abe991 parent c9450f71 file · +1 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/kcsan/kcsan_test.c+1−1
@@ -984,7 +984,7 @@ static const void *nthreads_gen_params(const void *prev, char *desc) · 983 unmodified lines
984984 const long min_required_cpus = 2 + min_unused_cpus;
985985
986986 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",
988988 num_online_cpus(), min_required_cpus);
989989 nthreads = 0;
990990 } else if (nthreads >= num_online_cpus() - min_unused_cpus) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t