[tip:locking/core] locking/lockdep: Declare local symbols static

From: tip-bot for Bart Van Assche
Date: Tue Dec 11 2018 - 10:27:20 EST


Commit-ID: 1431a5d2cfa18d7006d9b0e7ab4548d9bb19ce55
Gitweb: https://git.kernel.org/tip/1431a5d2cfa18d7006d9b0e7ab4548d9bb19ce55
Author: Bart Van Assche <bvanassche@xxxxxxx>
AuthorDate: Thu, 6 Dec 2018 17:11:32 -0800
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitDate: Tue, 11 Dec 2018 14:54:51 +0100

locking/lockdep: Declare local symbols static

This patch avoids that sparse complains about a missing declaration for
the lock_classes array when building with CONFIG_DEBUG_LOCKDEP=n.

Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Cc: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Sasha Levin <sasha.levin@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Waiman Long <longman@xxxxxxxxxx>
Cc: johannes.berg@xxxxxxxxx
Cc: tj@xxxxxxxxxx
Link: https://lkml.kernel.org/r/20181207011148.251812-9-bvanassche@xxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
kernel/locking/lockdep.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 1efada2dd9dd..7434a00b2b2f 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -138,6 +138,9 @@ static struct lock_list list_entries[MAX_LOCKDEP_ENTRIES];
* get freed - this significantly simplifies the debugging code.
*/
unsigned long nr_lock_classes;
+#ifndef CONFIG_DEBUG_LOCKDEP
+static
+#endif
struct lock_class lock_classes[MAX_LOCKDEP_KEYS];

static inline struct lock_class *hlock_class(struct held_lock *hlock)