summaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/unwind.c
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2017-08-04 23:54:19 +0200
committerHelge Deller <deller@gmx.de>2017-08-22 16:34:33 +0200
commit76cffeb6ccace1ae487e58d8d72b4519861a9d9e (patch)
tree557a380f095683fd44932c51f0da4d20ef1a78bb /arch/parisc/kernel/unwind.c
parent54ac8fcbd6e6777929235ac767467991005d2df3 (diff)
downloadlinux-76cffeb6ccace1ae487e58d8d72b4519861a9d9e.tar.bz2
parisc: Static initialization of spinlocks in perf and unwind code
While testing UBSAN I saw this BUG: BUG: spinlock bad magic on CPU#0, swapper/0 in unwind code. Let's avoid that by static initialization. Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/kernel/unwind.c')
-rw-r--r--arch/parisc/kernel/unwind.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c
index 1b73690477c5..48dc7d4d20bb 100644
--- a/arch/parisc/kernel/unwind.c
+++ b/arch/parisc/kernel/unwind.c
@@ -34,7 +34,7 @@
extern struct unwind_table_entry __start___unwind[];
extern struct unwind_table_entry __stop___unwind[];
-static spinlock_t unwind_lock;
+static DEFINE_SPINLOCK(unwind_lock);
/*
* the kernel unwind block is not dynamically allocated so that
* we can call unwind_init as early in the bootup process as
@@ -181,8 +181,6 @@ int __init unwind_init(void)
start = (long)&__start___unwind[0];
stop = (long)&__stop___unwind[0];
- spin_lock_init(&unwind_lock);
-
printk("unwind_init: start = 0x%lx, end = 0x%lx, entries = %lu\n",
start, stop,
(stop - start) / sizeof(struct unwind_table_entry));