Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756951Ab0KLKco (ORCPT ); Fri, 12 Nov 2010 05:32:44 -0500 Received: from hera.kernel.org ([140.211.167.34]:49108 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753832Ab0KLKcn (ORCPT ); Fri, 12 Nov 2010 05:32:43 -0500 Message-ID: <4CDD17A7.5060302@kernel.org> Date: Fri, 12 Nov 2010 11:32:07 +0100 From: Tejun Heo User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, eric.dumazet@gmail.com, yinghai@kernel.org Subject: [PATCH 3.5/9] x86: Use local variable to cache smp_processor_id() in setup_local_APIC() References: <1289473363-29440-1-git-send-email-tj@kernel.org> In-Reply-To: <1289473363-29440-1-git-send-email-tj@kernel.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (hera.kernel.org [127.0.0.1]); Fri, 12 Nov 2010 10:32:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2050 Lines: 64 This is a trivial clean up. Signed-off-by: Tejun Heo Cc: Yinghai Lu --- Separated out from patch 4 as suggested by Yinghai Lu. Thanks. arch/x86/kernel/apic/apic.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) Index: work/arch/x86/kernel/apic/apic.c =================================================================== --- work.orig/arch/x86/kernel/apic/apic.c +++ work/arch/x86/kernel/apic/apic.c @@ -1202,6 +1202,7 @@ static void __cpuinit lapic_setup_esr(vo */ void __cpuinit setup_local_APIC(void) { + int cpu = smp_processor_id(); unsigned int value, queued; int i, j, acked = 0; unsigned long long tsc = 0, ntsc; @@ -1343,21 +1344,19 @@ void __cpuinit setup_local_APIC(void) * TODO: set up through-local-APIC from through-I/O-APIC? --macro */ value = apic_read(APIC_LVT0) & APIC_LVT_MASKED; - if (!smp_processor_id() && (pic_mode || !value)) { + if (!cpu && (pic_mode || !value)) { value = APIC_DM_EXTINT; - apic_printk(APIC_VERBOSE, "enabled ExtINT on CPU#%d\n", - smp_processor_id()); + apic_printk(APIC_VERBOSE, "enabled ExtINT on CPU#%d\n", cpu); } else { value = APIC_DM_EXTINT | APIC_LVT_MASKED; - apic_printk(APIC_VERBOSE, "masked ExtINT on CPU#%d\n", - smp_processor_id()); + apic_printk(APIC_VERBOSE, "masked ExtINT on CPU#%d\n", cpu); } apic_write(APIC_LVT0, value); /* * only the BP should see the LINT1 NMI signal, obviously. */ - if (!smp_processor_id()) + if (!cpu) value = APIC_DM_NMI; else value = APIC_DM_NMI | APIC_LVT_MASKED; @@ -1369,7 +1368,7 @@ void __cpuinit setup_local_APIC(void) #ifdef CONFIG_X86_MCE_INTEL /* Recheck CMCI information after local APIC is up on CPU #0 */ - if (smp_processor_id() == 0) + if (cpu == 0) cmci_recheck(); #endif } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/