From: Milind Arun Choudhary <milindchoudhary@gmail.com>
To: kernel-janitors@lists.osdl.org
Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.arm.linux.org.uk
Subject: [KJ][RFC][PATCH]SPIN_LOCK_UNLOCKED cleanup in arch/arm
Date: Thu, 12 Apr 2007 02:12:17 +0530 [thread overview]
Message-ID: <20070411204217.GB10121@arun.site> (raw)
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
reply other threads:[~2007-04-11 20:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070411204217.GB10121@arun.site \
--to=milindchoudhary@gmail.com \
--cc=kernel-janitors@lists.osdl.org \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®