hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/lib/debug_locks.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * lib/debug_locks.c
34 *
....@@ -21,7 +22,7 @@
2122 * that would just muddy the log. So we report the first one and
2223 * shut up after that.
2324 */
24
-int debug_locks = 1;
25
+int debug_locks __read_mostly = 1;
2526 EXPORT_SYMBOL_GPL(debug_locks);
2627
2728 /*
....@@ -29,7 +30,7 @@
2930 * 'silent failure': nothing is printed to the console when
3031 * a locking bug is detected.
3132 */
32
-int debug_locks_silent;
33
+int debug_locks_silent __read_mostly;
3334 EXPORT_SYMBOL_GPL(debug_locks_silent);
3435
3536 /*
....@@ -37,12 +38,8 @@
3738 */
3839 int debug_locks_off(void)
3940 {
40
- if (debug_locks && __debug_locks_off()) {
41
- if (!debug_locks_silent) {
42
- console_verbose();
43
- return 1;
44
- }
45
- }
41
+ if (debug_locks && __debug_locks_off() && !debug_locks_silent)
42
+ return 1;
4643 return 0;
4744 }
4845 EXPORT_SYMBOL_GPL(debug_locks_off);