Skip to content

Commit 178a187

Browse files
melverpaulmckrcu
authored andcommitted
kcsan: Use pr_fmt for consistency
Use the same pr_fmt throughout for consistency. [ The only exception is report.c, where the format must be kept precisely as-is. ] Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 2778793 commit 178a187

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

kernel/kcsan/debugfs.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22

3+
#define pr_fmt(fmt) "kcsan: " fmt
4+
35
#include <linux/atomic.h>
46
#include <linux/bsearch.h>
57
#include <linux/bug.h>
@@ -80,7 +82,7 @@ static noinline void microbenchmark(unsigned long iters)
8082
*/
8183
WRITE_ONCE(kcsan_enabled, false);
8284

83-
pr_info("KCSAN: %s begin | iters: %lu\n", __func__, iters);
85+
pr_info("%s begin | iters: %lu\n", __func__, iters);
8486

8587
cycles = get_cycles();
8688
while (iters--) {
@@ -91,7 +93,7 @@ static noinline void microbenchmark(unsigned long iters)
9193
}
9294
cycles = get_cycles() - cycles;
9395

94-
pr_info("KCSAN: %s end | cycles: %llu\n", __func__, cycles);
96+
pr_info("%s end | cycles: %llu\n", __func__, cycles);
9597

9698
WRITE_ONCE(kcsan_enabled, was_enabled);
9799
/* restore context */
@@ -154,7 +156,7 @@ static ssize_t insert_report_filterlist(const char *func)
154156
ssize_t ret = 0;
155157

156158
if (!addr) {
157-
pr_err("KCSAN: could not find function: '%s'\n", func);
159+
pr_err("could not find function: '%s'\n", func);
158160
return -ENOENT;
159161
}
160162

kernel/kcsan/selftest.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22

3+
#define pr_fmt(fmt) "kcsan: " fmt
4+
35
#include <linux/init.h>
46
#include <linux/kernel.h>
57
#include <linux/printk.h>
@@ -116,16 +118,16 @@ static int __init kcsan_selftest(void)
116118
if (do_test()) \
117119
++passed; \
118120
else \
119-
pr_err("KCSAN selftest: " #do_test " failed"); \
121+
pr_err("selftest: " #do_test " failed"); \
120122
} while (0)
121123

122124
RUN_TEST(test_requires);
123125
RUN_TEST(test_encode_decode);
124126
RUN_TEST(test_matching_access);
125127

126-
pr_info("KCSAN selftest: %d/%d tests passed\n", passed, total);
128+
pr_info("selftest: %d/%d tests passed\n", passed, total);
127129
if (passed != total)
128-
panic("KCSAN selftests failed");
130+
panic("selftests failed");
129131
return 0;
130132
}
131133
postcore_initcall(kcsan_selftest);

0 commit comments

Comments
 (0)