lkml.org 
[lkml]   [2008]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 2/3] x86: apic - simplify lapic_get_maxlvt
Lets use lapic_get_version helper and hide
register being read. Also it allow us to
make code a bit tighter.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

Index: linux-2.6.git/arch/x86/kernel/apic.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic.c 2008-09-24 19:17:20.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/apic.c 2008-09-24 19:33:31.000000000 +0400
@@ -309,14 +309,14 @@ int get_physical_broadcast(void)
*/
int lapic_get_maxlvt(void)
{
- unsigned int v;
+ unsigned int ver;

- v = apic_read(APIC_LVR);
+ ver = lapic_get_version();
/*
* - we always have APIC integrated on 64bit mode
* - 82489DXs do not report # of LVT entries
*/
- return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2;
+ return APIC_INTEGRATED(ver) ? GET_APIC_MAXLVT(ver) : 2;
}

/*
--


\
 
 \ /
  Last update: 2008-09-24 18:53    [W:0.033 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site