lkml.org 
[lkml]   [2010]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 04/16] x86: Use local variable to cache smp_processor_id() in setup_local_APIC()
    Date
    This is a trivial clean up.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Cc: Yinghai Lu <yinghai@kernel.org>
    ---
    arch/x86/kernel/apic/apic.c | 13 ++++++-------
    1 files changed, 6 insertions(+), 7 deletions(-)

    diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
    index 3f838d5..2710f07 100644
    --- a/arch/x86/kernel/apic/apic.c
    +++ b/arch/x86/kernel/apic/apic.c
    @@ -1201,6 +1201,7 @@ static void __cpuinit lapic_setup_esr(void)
    */
    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;
    @@ -1342,21 +1343,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;
    @@ -1368,7 +1367,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
    }
    --
    1.7.1


    \
     
     \ /
      Last update: 2010-11-27 16:29    [W:4.711 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site