Skip to contentSkip to conversation

Strange initialization in arch/mips/kernel/smtc.c:1094?

DISCUSSION Rusty Russell 2 participants 2 messages Feb 9, 2009 MIPS

lore
Share & tools
lore
#0 lore raw

Latest Linus kernel, but it's been there a while:

static struct irqaction irq_ipi = {
.handler = ipi_interrupt,
.flags = IRQF_DISABLED,
.name = "SMTC_IPI",
.flags = IRQF_PERCPU
};

.flags is initialized twice: I'm amazed this even compiles.

Cheers,
Rusty.

#1 lore raw
Quoted 11 lines · Rusty Russell

Latest Linus kernel, but it's been there a while:

static struct irqaction irq_ipi = {
.handler = ipi_interrupt,
.flags = IRQF_DISABLED,
.name = "SMTC_IPI",
.flags = IRQF_PERCPU
};

.flags is initialized twice: I'm amazed this even compiles.

I don't know where that came from. The very earliest versions of smtc.c didn't have a declaration initialization at all, but filled the fields in setup_cross_vpe_interrupts(). The IRQ was PERCPU since day one. The initial DISABLED state came later. I'm guessing someone added that hastily and didn't notice the pre-existing .flags definition. I'm curious as to which bit(s) are actually set.

Regards,

Kevin K.