]> err.no Git - linux-2.6/commitdiff
[PATCH] Replace local_save_flags+local_irq_disable with
authorFernando Luis Vázquez Cao <fernando@oss.ntt.co.jp>
Tue, 26 Sep 2006 08:52:33 +0000 (10:52 +0200)
committerAndi Kleen <andi@basil.nowhere.org>
Tue, 26 Sep 2006 08:52:33 +0000 (10:52 +0200)
The combination of "local_save_flags" and "local_irq_disable" seems to be
equivalent to "local_irq_save" (see code snips below). Consequently, replace
occurrences of local_save_flags+local_irq_disable with local_irq_save.

* local_irq_save
#define raw_local_irq_save(flags) \
                do { (flags) = __raw_local_irq_save(); } while (0)

static inline unsigned long __raw_local_irq_save(void)
{
        unsigned long flags = __raw_local_save_flags();

        raw_local_irq_disable();

        return flags;
}

* local_save_flags
#define raw_local_save_flags(flags) \
                do { (flags) = __raw_local_save_flags(); } while (0)

Signed-off-by: Fernando Vazquez <fernando@intellilink.co.jp>
Signed-off-by: Andi Kleen <ak@suse.de>
arch/x86_64/kernel/apic.c
arch/x86_64/kernel/genapic_flat.c

index 660602c51f51789a30770c74cbc2d91317e7e1da..b95d1e378b96a19ec307ba8264edb3f3100e6258 100644 (file)
@@ -468,8 +468,7 @@ static int lapic_suspend(struct sys_device *dev, pm_message_t state)
        apic_pm_state.apic_tmict = apic_read(APIC_TMICT);
        apic_pm_state.apic_tdcr = apic_read(APIC_TDCR);
        apic_pm_state.apic_thmr = apic_read(APIC_LVTTHMR);
-       local_save_flags(flags);
-       local_irq_disable();
+       local_irq_save(flags);
        disable_local_APIC();
        local_irq_restore(flags);
        return 0;
index 2ceb8b872b5798ae8df993c0dfc2c4ebd1404e6c..50ad153eaac416f42d7d93f90b23e23a11df07c7 100644 (file)
@@ -49,8 +49,7 @@ static void flat_send_IPI_mask(cpumask_t cpumask, int vector)
        unsigned long cfg;
        unsigned long flags;
 
-       local_save_flags(flags);
-       local_irq_disable();
+       local_irq_save(flags);
 
        /*
         * Wait for idle.