Skip to content

Commit

Permalink
x86: pre init pirq_entries[]
Browse files Browse the repository at this point in the history
Impact: cleanup

set default value early - this allows the removal of a number
of dynamic initialization codepaths, and an #ifdef.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Feb 16, 2009
1 parent 88d0f55 commit 3bd25d0
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions arch/x86/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -823,10 +824,6 @@ static int __init ioapic_pirq_setup(char *str)

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;
Expand Down Expand Up @@ -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):
*/
Expand Down

0 comments on commit 3bd25d0

Please sign in to comment.