lkml.org 
[lkml]   [2005]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] ARCH_HAS_IRQ_PER_CPU avoids dead code in __do_IRQ()
Date
Am Samstag, 6. August 2005 23:28 schrieb Ingo Oeser:
> Hi Karsten,
>
> On Saturday 06 August 2005 18:14, Karsten Wiese wrote:
> > From: Karsten Wiese <annabellesgarden@yahoo.de>
> >
> > IRQ_PER_CPU is not used by all architectures.
> > To avoid dead code generation in __do_IRQ()
> > this patch introduces the macro ARCH_HAS_IRQ_PER_CPU.
> >
> > ARCH_HAS_IRQ_PER_CPU is defined by architectures using
> > IRQ_PER_CPU in their
> > include/asm_ARCH/irq.h
> > file.
>
> Why not the other way around?
>
> Just define IRQ_PER_CPU to 0 on architectures not needing it and
> add a FAT comment there, that this disables it. Or make it a config option.
>
> Then just leave the code as is and let GCC optimize the dead code
> away without any changes in the C file. It works, I just checked it ;-)
>
With my proposal the
#if defined(ARCH_HAS_IRQ_PER_CPU)
....
#endif
lets readers of __do_IRQ() immediately grasp:
"this block might not be compiled / depends an ARCH"
And you'll get compile error's using IRQ_PER_CPU on ie i386,
letting you immediately know,
that you've got to change something to be able to use IRQ_PER_CPU.

That are advantages I think.
Otherwise your proposal is ok for me too.

Regards,
Karsten





___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-07 12:29    [W:0.744 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site