* [KJ][RFC][PATCH]SPIN_LOCK_UNLOCKED cleanup in arch/arm
@ 2007-04-11 20:42 Milind Arun Choudhary
0 siblings, 0 replies; only message in thread
From: Milind Arun Choudhary @ 2007-04-11 20:42 UTC (permalink / raw)
To: kernel-janitors; +Cc: linux-kernel, linux-arm-kernel
for arch/arm/kernel/smp.c
static DEFINE_PER_CPU(struct ipi_data, ipi_data) = {
will give a struct with name per_cpu__ipi_data
so I did
- .lock = SPIN_LOCK_UNLOCKED,
+ .lock = __SPIN_LOCK_UNLOCKED(per_cpu__ipi_data.lock),
but this dosen't seem to be the right thing to do..
the DEFINE_PER_CPU macro internally creates an instance of
the type passed with name as "per_cpu__##name"
the prefix should not be assumed i think
.if the DEFINE_PER_CPU changes ,this code will break..
how do we go about it?
thoughts!
plz CMIIW
---
kernel/irq.c | 2 +-
kernel/smp.c | 2 +-
kernel/time.c | 2 +-
mach-omap2/gpmc.c | 2 +-
mach-pnx4008/dma.c | 4 ++--
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index e101846..0cbd51c 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -101,7 +101,7 @@ unlock:
/* Handle bad interrupts */
static struct irq_desc bad_irq_desc = {
.handle_irq = handle_bad_irq,
- .lock = SPIN_LOCK_UNLOCKED
+ .lock = __SPIN_LOCK_UNLOCKED(bad_irq_desc.lock)
};
/*
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 070bcb7..cf8341d 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -60,7 +60,7 @@ struct ipi_data {
};
static DEFINE_PER_CPU(struct ipi_data, ipi_data) = {
- .lock = SPIN_LOCK_UNLOCKED,
+ .lock = __SPIN_LOCK_UNLOCKED(per_cpu__ipi_data.lock),
};
enum ipi_msg_type {
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index d8f5782..d2b08b4 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -54,7 +54,7 @@
static struct resource gpmc_mem_root;
static struct resource gpmc_cs_mem[GPMC_CS_NUM];
-static spinlock_t gpmc_mem_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(gpmc_mem_lock);
static unsigned gpmc_cs_map;
static void __iomem *gpmc_base =
diff --git a/arch/arm/mach-pnx4008/dma.c b/arch/arm/mach-pnx4008/dma.c
index d6a279e..f7009d8 100644
--- a/arch/arm/mach-pnx4008/dma.c
+++ b/arch/arm/mach-pnx4008/dma.c
@@ -47,7 +47,7 @@ static struct ll_pool {
int count;
} ll_pool;
-static spinlock_t ll_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(ll_lock);
struct pnx4008_dma_ll *pnx4008_alloc_ll_entry(dma_addr_t * ll_dma)
{
@@ -135,7 +135,7 @@ static inline void dma_decrement_usage(void)
}
}
-static spinlock_t dma_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(dma_lock);
static inline void pnx4008_dma_lock(void)
{
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index f61decb..77e7f20 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -510,7 +510,7 @@ void __init time_init(void)
#ifdef CONFIG_NO_IDLE_HZ
if (system_timer->dyn_tick)
- system_timer->dyn_tick->lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&system_timer->dyn_tick->lock);
#endif
}
--
Milind Arun Choudhary
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-04-11 20:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-11 20:42 [KJ][RFC][PATCH]SPIN_LOCK_UNLOCKED cleanup in arch/arm Milind Arun Choudhary
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®