]> git.karo-electronics.de Git - linux-beck.git/commitdiff
genirq: Force wrapped access to desc->status in core code
authorThomas Gleixner <tglx@linutronix.de>
Wed, 9 Feb 2011 13:54:49 +0000 (14:54 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 19 Feb 2011 11:58:21 +0000 (12:58 +0100)
Force the usage of wrappers by another nasty CPP substitution.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/handle.c
kernel/irq/irqdesc.c
kernel/irq/settings.h

index 6e34bdbeb26a48e9918d60f10bbd35b07420bbf4..cb62e2d0df4e7c2d495389d48f3d08bf99e86a70 100644 (file)
@@ -55,7 +55,7 @@ irqreturn_t
 handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
 {
        irqreturn_t ret, retval = IRQ_NONE;
-       unsigned int status = 0, irq = desc->irq_data.irq;
+       unsigned int random = 0, irq = desc->irq_data.irq;
 
        do {
                trace_irq_handler_entry(irq, action);
@@ -98,7 +98,7 @@ handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
 
                        /* Fall through to add to randomness */
                case IRQ_HANDLED:
-                       status |= action->flags;
+                       random |= action->flags;
                        break;
 
                default:
@@ -109,7 +109,7 @@ handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
                action = action->next;
        } while (action);
 
-       if (status & IRQF_SAMPLE_RANDOM)
+       if (random & IRQF_SAMPLE_RANDOM)
                add_interrupt_randomness(irq);
 
        if (!noirqdebug)
index 78866d050bc9ae55793ba5baf77b7c0459a4d025..3387fbd7f2f425c26ba8f5f8028ce1fd7e3d014b 100644 (file)
@@ -79,7 +79,7 @@ static void desc_set_defaults(unsigned int irq, struct irq_desc *desc, int node)
        desc->irq_data.chip_data = NULL;
        desc->irq_data.handler_data = NULL;
        desc->irq_data.msi_desc = NULL;
-       desc->status = _IRQ_DEFAULT_INIT_FLAGS;
+       irq_settings_clr_and_set(desc, ~0, _IRQ_DEFAULT_INIT_FLAGS);
        desc->istate = IRQS_DISABLED;
        desc->handle_irq = handle_bad_irq;
        desc->depth = 1;
@@ -247,7 +247,6 @@ int __init early_irq_init(void)
 
 struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = {
        [0 ... NR_IRQS-1] = {
-               .status         = _IRQ_DEFAULT_INIT_FLAGS,
                .istate         = IRQS_DISABLED,
                .handle_irq     = handle_bad_irq,
                .depth          = 1,
@@ -271,6 +270,7 @@ int __init early_irq_init(void)
                desc[i].irq_data.irq = i;
                desc[i].irq_data.chip = &no_irq_chip;
                desc[i].kstat_irqs = alloc_percpu(unsigned int);
+               irq_settings_clr_and_set(desc, ~0, _IRQ_DEFAULT_INIT_FLAGS);
                alloc_masks(desc + i, GFP_KERNEL, node);
                desc_smp_init(desc + i, node);
                lockdep_set_class(&desc[i].lock, &irq_desc_lock_class);
index 216b6f200e7c2b3cd6c997edfc3a1a857d8ce8b6..47bcd3b9f3998c101b78857b21a55ae7ea439fb6 100644 (file)
@@ -148,3 +148,6 @@ static inline bool irq_settings_is_nested_thread(struct irq_desc *desc)
 {
        return desc->status & _IRQ_NESTED_THREAD;
 }
+
+/* Nothing should touch desc->status from now on */
+#define status         USE_THE_PROPER_WRAPPERS_YOU_MORON