Skip to contentSkip to conversation

dead code in ipipe_grab_irq

Xenomai-core Anders Blomdell 3 participants 3 messages Jan 30, 2006

lore
Share & tools
lore
#0 lore raw

In the following code (ppc), shouldn't first be either declared static or deleted? To me it looks like first is always equal to one when the else clause is evaluated.

asmlinkage int __ipipe_grab_irq(struct pt_regs *regs)

{
        extern int ppc_spurious_interrupts;
        ipipe_declare_cpuid;
        int irq, first = 1;

        if ((irq = ppc_md.get_irq(regs)) >= 0) {
                __ipipe_handle_irq(irq, regs);
                first = 0;
        } else if (irq != -2 && first)
                ppc_spurious_interrupts++;

        ipipe_load_cpuid();

        return (ipipe_percpu_domain[cpuid] == ipipe_root_domain &&
                !test_bit(IPIPE_STALL_FLAG,
                          &ipipe_root_domain->cpudata[cpuid].status));
}

Regards

Anders Blomdell

#1 lore raw

Anders Blomdell kirjoitti:

Quoted 1 line

In the following code (ppc), shouldn't first be either declared static or deleted? To me it looks like first is always equal to one when the else clause is evaluated.

You're right. "first" doesn't need to be there at all, it's probably an old copy of something in the kernel.

Quoted 30 lines

asmlinkage int __ipipe_grab_irq(struct pt_regs *regs)

{
        extern int ppc_spurious_interrupts;
        ipipe_declare_cpuid;
        int irq, first = 1;

        if ((irq = ppc_md.get_irq(regs)) >= 0) {
                __ipipe_handle_irq(irq, regs);
                first = 0;
        } else if (irq != -2 && first)
                ppc_spurious_interrupts++;

        ipipe_load_cpuid();

        return (ipipe_percpu_domain[cpuid] == ipipe_root_domain &&
                !test_bit(IPIPE_STALL_FLAG,
                          &ipipe_root_domain->cpudata[cpuid].status));
}

Regards

Anders Blomdell

_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core

#2 lore raw
Quoted 7 lines · Heikki Lindholm

Anders Blomdell kirjoitti:

Quoted 1 line

In the following code (ppc), shouldn't first be either declared static or deleted? To me it looks like first is always equal to one when the else clause is evaluated.

You're right. "first" doesn't need to be there at all, it's probably an old copy of something in the kernel.

Yep; used to be a while() loop in the original implementation we do not perform here.

Quoted 38 lines
Quoted 22 lines

asmlinkage int __ipipe_grab_irq(struct pt_regs *regs)

{
        extern int ppc_spurious_interrupts;
        ipipe_declare_cpuid;
        int irq, first = 1;

        if ((irq = ppc_md.get_irq(regs)) >= 0) {
                __ipipe_handle_irq(irq, regs);
                first = 0;
        } else if (irq != -2 && first)
                ppc_spurious_interrupts++;

        ipipe_load_cpuid();

        return (ipipe_percpu_domain[cpuid] == ipipe_root_domain &&
                !test_bit(IPIPE_STALL_FLAG,
                          &ipipe_root_domain->cpudata[cpuid].status));
}

Regards

Quoted 8 lines

Anders Blomdell

_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core

_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core

Signature · 1 line
Philippe.