Skip to content

Commit

Permalink
[PATCH] Replace local_save_flags+local_irq_disable with
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fernando Luis V�zquez Cao authored and Andi Kleen committed Sep 26, 2006
1 parent 52d522f commit 2b94ab2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions arch/x86_64/kernel/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions arch/x86_64/kernel/genapic_flat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2b94ab2

Please sign in to comment.