diff options
author | Helge Deller <deller@gmx.de> | 2017-08-05 00:54:19 +0300 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2017-08-22 17:34:33 +0300 |
commit | 76cffeb6ccace1ae487e58d8d72b4519861a9d9e (patch) | |
tree | 557a380f095683fd44932c51f0da4d20ef1a78bb /arch/parisc/kernel/perf.c | |
parent | 54ac8fcbd6e6777929235ac767467991005d2df3 (diff) | |
download | linux-76cffeb6ccace1ae487e58d8d72b4519861a9d9e.tar.xz |
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/perf.c')
-rw-r--r-- | arch/parisc/kernel/perf.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c index 6017a5af2e6e..0813359049ae 100644 --- a/arch/parisc/kernel/perf.c +++ b/arch/parisc/kernel/perf.c @@ -69,7 +69,7 @@ struct rdr_tbl_ent { static int perf_processor_interface __read_mostly = UNKNOWN_INTF; static int perf_enabled __read_mostly; -static spinlock_t perf_lock; +static DEFINE_SPINLOCK(perf_lock); struct parisc_device *cpu_device __read_mostly; /* RDRs to write for PCX-W */ @@ -533,8 +533,6 @@ static int __init perf_init(void) /* Patch the images to match the system */ perf_patch_images(); - spin_lock_init(&perf_lock); - /* TODO: this only lets us access the first cpu.. what to do for SMP? */ cpu_device = per_cpu(cpu_data, 0).dev; printk("Performance monitoring counters enabled for %s\n", |