All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [BUG?] dead code in ipipe_grab_irq
@ 2006-01-30 14:58 Anders Blomdell
  2006-01-30 15:37 ` Heikki Lindholm
  0 siblings, 1 reply; 3+ messages in thread
From: Anders Blomdell @ 2006-01-30 14:58 UTC (permalink / raw)
  To: xenomai

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Xenomai-core] [BUG?] dead code in ipipe_grab_irq
  2006-01-30 14:58 [Xenomai-core] [BUG?] dead code in ipipe_grab_irq Anders Blomdell
@ 2006-01-30 15:37 ` Heikki Lindholm
  2006-01-30 15:57   ` Philippe Gerum
  0 siblings, 1 reply; 3+ messages in thread
From: Heikki Lindholm @ 2006-01-30 15:37 UTC (permalink / raw)
  To: Anders Blomdell; +Cc: xenomai

Anders Blomdell kirjoitti:
> 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.

> 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
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Xenomai-core] [BUG?] dead code in ipipe_grab_irq
  2006-01-30 15:37 ` Heikki Lindholm
@ 2006-01-30 15:57   ` Philippe Gerum
  0 siblings, 0 replies; 3+ messages in thread
From: Philippe Gerum @ 2006-01-30 15:57 UTC (permalink / raw)
  To: Heikki Lindholm; +Cc: xenomai

Heikki Lindholm wrote:
> Anders Blomdell kirjoitti:
> 
>> 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.

>> 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
>> Xenomai-core@domain.hid
>> https://mail.gna.org/listinfo/xenomai-core
> 
> 
> 
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
> 


-- 

Philippe.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-30 15:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-30 14:58 [Xenomai-core] [BUG?] dead code in ipipe_grab_irq Anders Blomdell
2006-01-30 15:37 ` Heikki Lindholm
2006-01-30 15:57   ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.