Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1728039 > unrolled thread
| Started by | Dou Liyang <douly.fnst@cn.fujitsu.com> |
|---|---|
| First post | 2017-09-07 10:50 +0200 |
| Last post | 2017-09-07 10:50 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 1/2] x86/apic: Remove duplicate judgement of X86_64 in lapic_is_integrated() Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-07 10:50 +0200
[PATCH 2/2] x86/apic: Convert APIC_INTEGRATED to lapic_is_integrated() in apic.c Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-07 10:50 +0200
| From | Dou Liyang <douly.fnst@cn.fujitsu.com> |
|---|---|
| Date | 2017-09-07 10:50 +0200 |
| Subject | [PATCH 1/2] x86/apic: Remove duplicate judgement of X86_64 in lapic_is_integrated() |
| Message-ID | <un0Fz-5YE-1@gated-at.bofh.it> |
The macro APIC_INTEGRATED(x) has already wrapped by CONFIG_X86_32. So
Invoke it directly.
But lapic_is_integrated() invokes APIC_INTEGRATED(x) with the duplicate
judgement of X86_64.
Remove the "#ifdef CONFIG_X86_64...". No functionality change.
Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
---
arch/x86/kernel/apic/apic.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 7834f73..63b3ae9 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -211,11 +211,7 @@ static inline int lapic_get_version(void)
*/
static inline int lapic_is_integrated(void)
{
-#ifdef CONFIG_X86_64
- return 1;
-#else
return APIC_INTEGRATED(lapic_get_version());
-#endif
}
/*
--
2.5.5
[toc] | [next] | [standalone]
| From | Dou Liyang <douly.fnst@cn.fujitsu.com> |
|---|---|
| Date | 2017-09-07 10:50 +0200 |
| Subject | [PATCH 2/2] x86/apic: Convert APIC_INTEGRATED to lapic_is_integrated() in apic.c |
| Message-ID | <un0FA-5YE-17@gated-at.bofh.it> |
| In reply to | #1728039 |
Currently, lapic_is_integrated() encapsulates APIC_INTEGRATED() in
apic.c for a concise call.
But lapic_get_maxlvt() is overlooked.
Convert to lapic_is_integrated() and fix two code formats.
No functionality change
Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
---
arch/x86/kernel/apic/apic.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 63b3ae9..b81ebbf 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -294,14 +294,11 @@ int get_physical_broadcast(void)
*/
int lapic_get_maxlvt(void)
{
- unsigned int v;
-
- v = apic_read(APIC_LVR);
/*
* - 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 lapic_is_integrated(void) ? GET_APIC_MAXLVT(v) : 2;
}
/*
@@ -1256,7 +1253,9 @@ void __init init_bsp_APIC(void)
*/
apic_write(APIC_LVT0, APIC_DM_EXTINT);
value = APIC_DM_NMI;
- if (!lapic_is_integrated()) /* 82489DX */
+
+ /* Is 82489DX ? */
+ if (!lapic_is_integrated())
value |= APIC_LVT_LEVEL_TRIGGER;
if (apic_extnmi == APIC_EXTNMI_NONE)
value |= APIC_LVT_MASKED;
@@ -1484,7 +1483,9 @@ void setup_local_APIC(void)
value = APIC_DM_NMI;
else
value = APIC_DM_NMI | APIC_LVT_MASKED;
- if (!lapic_is_integrated()) /* 82489DX */
+
+ /* Is 82489DX ? */
+ if (!lapic_is_integrated())
value |= APIC_LVT_LEVEL_TRIGGER;
apic_write(APIC_LVT1, value);
--
2.5.5
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web