Skip to contentSkip to conversation

x86: pre init pirq_entries[]

PATCH Applied Yinghai Lu 2 participants 2 messages Feb 15, 2009 – Feb 16, 2009 x86

lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 x86: pre init pirq_entries[]

Impact: cleanup

set default value early. also could remove pirqs_enabled... and one #ifdef

---
 arch/x86/kernel/io_apic.c |   16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
arch/x86/kernel/io_apic.c +3 -13
Index: linux-2.6/arch/x86/kernel/io_apic.c
===================================================================
@@ -813,8 +813,9 @@ static void clear_IO_APIC (void)
  */
 
 #define MAX_PIRQS 8
-static int pirq_entries [MAX_PIRQS];
-static int pirqs_enabled;
+static int pirq_entries[MAX_PIRQS] = {
+	[0 ... MAX_PIRQS - 1] = -1
+};
 
 static int __init ioapic_pirq_setup(char *str)
 {
@@ -823,10 +824,6 @@ static int __init ioapic_pirq_setup(char
 
 	get_options(str, ARRAY_SIZE(ints), ints);
 
-	for (i = 0; i < MAX_PIRQS; i++)
-		pirq_entries[i] = -1;
-
-	pirqs_enabled = 1;
 	apic_printk(APIC_VERBOSE, KERN_INFO
 			"PIRQ redirection, working around broken MP-BIOS.\n");
 	max = MAX_PIRQS;
@@ -1976,13 +1973,6 @@ void __init enable_IO_APIC(void)
 	int apic;
 	unsigned long flags;
 
-#ifdef CONFIG_X86_32
-	int i;
-	if (!pirqs_enabled)
-		for (i = 0; i < MAX_PIRQS; i++)
-			pirq_entries[i] = -1;
-#endif
-
 	/*
 	 * The number of IO-APIC IRQ registers (== #pins):
 	 */
Applied
#1 lore raw
Quoted 10 lines · Yinghai Lu

Impact: cleanup

set default value early. also could remove pirqs_enabled... and one #ifdef

---
 arch/x86/kernel/io_apic.c |   16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

Applied to tip:x86/apic, thanks Yinghai!

Ingo