[patch 01/16] arm: Replace old style lock initializer

Thomas Gleixner
2009-11-06T22:41:36Z

[-- Attachment #1: arm-remove-old-style-lock-init.patch --]
[-- Type: text/plain, Size: 1043 bytes --]

SPIN_LOCK_UNLOCKED is deprecated. Initialize the per cpu ipi locks via
spin_lock_init.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: patches@arm.linux.org.uk
Cc: Russell King <rmk+kernel@arm.linux.org.uk>

---
arch/arm/kernel/smp.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

Index: linux-2.6/arch/arm/kernel/smp.c
===================================================================
--- linux-2.6.orig/arch/arm/kernel/smp.c
+++ linux-2.6/arch/arm/kernel/smp.c
@@ -55,9 +55,7 @@ struct ipi_data {
unsigned long bits;
};

-static DEFINE_PER_CPU(struct ipi_data, ipi_data) = {
- .lock = SPIN_LOCK_UNLOCKED,
-};
+static DEFINE_PER_CPU(struct ipi_data, ipi_data);

enum ipi_msg_type {
IPI_TIMER,
@@ -329,6 +327,9 @@ void __init smp_prepare_boot_cpu(void)
unsigned int cpu = smp_processor_id();

per_cpu(cpu_data, cpu).idle = current;
+
+ for_each_possible_cpu(cpu)
+ spin_lock_init(&per_cpu(ipi_data, cpu).lock);
}

static void send_ipi_message(const struct cpumask *mask, enum ipi_msg_type msg)