Skip to contentSkip to conversation

early-quirks: remove duplicate #ifdef

PATCH In review Jeremy Fitzhardinge 2 participants 3 messages Apr 6, 2009 – Apr 8, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 early-quirks: remove duplicate #ifdef

"#if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC)" was repeated twice.

arch/x86/kernel/early-quirks.c +0 -0
index ebdb85c..76b8cd9 100644
@@ -97,7 +97,6 @@ static void __init nvidia_bugs(int num, int slot, int func)

}

#if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC) -#if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC) static u32 __init ati_ixp4x0_rev(int num, int slot, int func)

{
	u32 d;
@@ -115,7 +114,6 @@ static u32 __init ati_ixp4x0_rev(int num, int slot, int func)
	d &= 0xff;
	return d;
}

-#endif

static void __init ati_bugs(int num, int slot, int func) {

#1 lore raw
Quoted 4 lines · Jeremy Fitzhardinge

"#if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC)" was repeated twice.

hm, this was due to the patch below. Your patch essentially reverts that patch?

Ingo

--------------->

Quoted 1 line

From a59dacfdc9ba06903652fa4883bf1106278b18ec Mon Sep 17 00:00:00 2001

From: Ingo Molnar <[email protected]>
Date: Fri, 17 Oct 2008 14:38:08 +0200
Subject: [PATCH] x86 early quirks: eliminate unused function
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Impact: cleanup

this warning:

arch/x86/kernel/early-quirks.c:99: warning: ‘ati_ixp4x0_rev’ defined but not used

triggers because ati_ixp4x0_rev() is only used in the ACPI && X86_IO_APIC case.

---
 arch/x86/kernel/early-quirks.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/kernel/early-quirks.c +2 -0
index 76b8cd9..ebdb85c 100644
@@ -97,6 +97,7 @@ static void __init nvidia_bugs(int num, int slot, int func)
 }
 
 #if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC)
+#if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC)
 static u32 __init ati_ixp4x0_rev(int num, int slot, int func)
 {
 	u32 d;
@@ -114,6 +115,7 @@ static u32 __init ati_ixp4x0_rev(int num, int slot, int func)
 	d &= 0xff;
 	return d;
 }
+#endif
 
 static void __init ati_bugs(int num, int slot, int func)
 {
#2 lore raw
Quoted 11 lines · Ingo Molnar
Quoted 5 lines · Jeremy Fitzhardinge

"#if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC)" was repeated twice.

hm, this was due to the patch below. Your patch essentially reverts that patch?

Is that patch the result of a merge?

With that patch in place, the code structure is essentially:

#if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC) #if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC) static u32 __init ati_ixp4x0_rev(int num, int slot, int func)

{
	...
}

#endif

...
#endif

I can't see how the inner #if is doing anything useful at all.

J

Quoted 46 lines

Ingo

--------------->
From a59dacfdc9ba06903652fa4883bf1106278b18ec Mon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
Date: Fri, 17 Oct 2008 14:38:08 +0200
Subject: [PATCH] x86 early quirks: eliminate unused function
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Impact: cleanup

this warning:

arch/x86/kernel/early-quirks.c:99: warning: ‘ati_ixp4x0_rev’ defined but not used

triggers because ati_ixp4x0_rev() is only used in the ACPI && X86_IO_APIC case.

---
 arch/x86/kernel/early-quirks.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/kernel/early-quirks.c +2 -0
index 76b8cd9..ebdb85c 100644
@@ -97,6 +97,7 @@ static void __init nvidia_bugs(int num, int slot, int func)
 }
 
 #if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC)
+#if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC)
 static u32 __init ati_ixp4x0_rev(int num, int slot, int func)
 {
 	u32 d;
@@ -114,6 +115,7 @@ static u32 __init ati_ixp4x0_rev(int num, int slot, int func)
 	d &= 0xff;
 	return d;
 }
+#endif
 
 static void __init ati_bugs(int num, int slot, int func)
 {