mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
locking, irq: enclose irq_desc_lock_class in CONFIG_LOCKDEP
Impact: simplify code
commit "08678b0
: generic: sparse irqs: use irq_desc() [...]" introduced
the irq_desc_lock_class variable.
But it is used only if CONFIG_SPARSE_IRQ=Y or CONFIG_TRACE_IRQFLAGS=Y.
Otherwise, following warnings happen:
CC kernel/irq/handle.o
kernel/irq/handle.c:26: warning: 'irq_desc_lock_class' defined but not used
Actually, current early_init_irq_lock_class has a bit strange and messy ifdef.
In addition, it is not valueable.
1. this function is protected by !CONFIG_SPARSE_IRQ, but that is not necessary.
if CONFIG_SPARSE_IRQ=Y, desc of all irq number are initialized by NULL
at first - then this function calling is safe.
2. this function protected by CONFIG_TRACE_IRQFLAGS too. but it is not
necessary either, because lockdep_set_class() doesn't have bad side
effect even if CONFIG_TRACE_IRQFLAGS=n.
This patch bloat kernel size a bit on CONFIG_TRACE_IRQFLAGS=n and
CONFIG_SPARSE_IRQ=Y - but that's ok. early_init_irq_lock_class() is not
a fastpatch at all.
To avoid messy ifdefs is more important than a few bytes diet.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
6f8a0ed4e5
commit
74c8a61304
2 changed files with 1 additions and 6 deletions
|
@ -377,7 +377,7 @@ do { \
|
||||||
|
|
||||||
#endif /* CONFIG_LOCK_STAT */
|
#endif /* CONFIG_LOCK_STAT */
|
||||||
|
|
||||||
#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS)
|
#ifdef CONFIG_GENERIC_HARDIRQS
|
||||||
extern void early_init_irq_lock_class(void);
|
extern void early_init_irq_lock_class(void);
|
||||||
#else
|
#else
|
||||||
static inline void early_init_irq_lock_class(void)
|
static inline void early_init_irq_lock_class(void)
|
||||||
|
|
|
@ -422,11 +422,8 @@ out:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_TRACE_IRQFLAGS
|
|
||||||
void early_init_irq_lock_class(void)
|
void early_init_irq_lock_class(void)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_SPARSE_IRQ
|
|
||||||
struct irq_desc *desc;
|
struct irq_desc *desc;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -436,9 +433,7 @@ void early_init_irq_lock_class(void)
|
||||||
|
|
||||||
lockdep_set_class(&desc->lock, &irq_desc_lock_class);
|
lockdep_set_class(&desc->lock, &irq_desc_lock_class);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_SPARSE_IRQ
|
#ifdef CONFIG_SPARSE_IRQ
|
||||||
unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
|
unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue