summaryrefslogtreecommitdiff
path: root/kernel/kcsan/report.c
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2020-08-10 10:06:25 +0200
committerPaul E. McKenney <paulmck@kernel.org>2020-08-24 15:10:23 -0700
commit2e986b81f698e73c95e6456183f27b861f47bb87 (patch)
tree9a839aaf053ad9afb3de552674d66cd9a40bfda5 /kernel/kcsan/report.c
parent178a1877d782c034f466edd80e30a107af5469df (diff)
kcsan: Optimize debugfs stats counters
Remove kcsan_counter_inc/dec() functions, as they perform no other logic, and are no longer needed. This avoids several calls in kcsan_setup_watchpoint() and kcsan_found_watchpoint(), as well as lets the compiler warn us about potential out-of-bounds accesses as the array's size is known at all usage sites at compile-time. Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/kcsan/report.c')
-rw-r--r--kernel/kcsan/report.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/kcsan/report.c b/kernel/kcsan/report.c
index bf1d59449805..d3bf87e6007c 100644
--- a/kernel/kcsan/report.c
+++ b/kernel/kcsan/report.c
@@ -559,7 +559,7 @@ static bool prepare_report_consumer(unsigned long *flags,
* If the actual accesses to not match, this was a false
* positive due to watchpoint encoding.
*/
- kcsan_counter_inc(KCSAN_COUNTER_ENCODING_FALSE_POSITIVES);
+ atomic_long_inc(&kcsan_counters[KCSAN_COUNTER_ENCODING_FALSE_POSITIVES]);
goto discard;
}