public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86_64: Replace local_save_flags+local_irq_disable with local_irq_save.
@ 2006-08-02 10:11 Fernando Luis Vázquez Cao
  2006-08-02 10:18 ` Andi Kleen
  0 siblings, 1 reply; 2+ messages in thread
From: Fernando Luis Vázquez Cao @ 2006-08-02 10:11 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

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>
---

diff -urNp linux-2.6.18-rc3/arch/x86_64/kernel/apic.c linux-2.6.18-rc3-orig/arch/x86_64/kernel/apic.c
--- linux-2.6.18-rc3/arch/x86_64/kernel/apic.c	2006-08-02 18:05:41.000000000 +0900
+++ linux-2.6.18-rc3-orig/arch/x86_64/kernel/apic.c	2006-08-02 18:08:24.000000000 +0900
@@ -527,8 +527,7 @@ static int lapic_suspend(struct sys_devi
 	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;
diff -urNp linux-2.6.18-rc3/arch/x86_64/kernel/genapic_flat.c linux-2.6.18-rc3-orig/arch/x86_64/kernel/genapic_flat.c
--- linux-2.6.18-rc3/arch/x86_64/kernel/genapic_flat.c	2006-08-02 18:05:41.000000000 +0900
+++ linux-2.6.18-rc3-orig/arch/x86_64/kernel/genapic_flat.c	2006-08-02 18:09:18.000000000 +0900
@@ -49,8 +49,7 @@ static void flat_send_IPI_mask(cpumask_t
 	unsigned long cfg;
 	unsigned long flags;
 
-	local_save_flags(flags);
-	local_irq_disable();
+	local_irq_save(flags);
 
 	/*
 	 * Wait for idle.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86_64: Replace local_save_flags+local_irq_disable with local_irq_save.
  2006-08-02 10:11 [PATCH] x86_64: Replace local_save_flags+local_irq_disable with local_irq_save Fernando Luis Vázquez Cao
@ 2006-08-02 10:18 ` Andi Kleen
  0 siblings, 0 replies; 2+ messages in thread
From: Andi Kleen @ 2006-08-02 10:18 UTC (permalink / raw)
  To: Fernando Luis Vázquez Cao; +Cc: linux-kernel

On Wednesday 02 August 2006 12:11, Fernando Luis Vázquez Cao wrote:
> 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.

Added thanks

-Andi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-02 10:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-02 10:11 [PATCH] x86_64: Replace local_save_flags+local_irq_disable with local_irq_save Fernando Luis Vázquez Cao
2006-08-02 10:18 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox