lkml.org 
[lkml]   [2005]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Serial maintainership


On Thu, 8 Sep 2005, David S. Miller wrote:
>
> > the "regs" argument may not exist in the parent context in the
> > !SUPPORT_SYSRQ case.
>
> Then pass in a NULL in the ARM serial drivers instead of this ugly
> dependency upon the macro not using the argument.

No, the ARM driver -does- want to pass in "regs" for the SYSRQ case, it's
just that "regs" doesn't even exist when SYSRQ is not enabled. Look into
drivers/serial/amba-pl010.c as an example.

Yes, it's a bit ugly, but we've had similar cases in other places. And
it's likely a valid optimization, and the old code worked beautifully by
just not even caring when "regs" wasn't used due to SYSRQ not being
enabled.

We've had somewhat similar cases where optimizations depended on macros
not even expanding their arguments when they aren't used (ie the arguments
might be expensive to expand: function calls or inline asm that the
compiler can't remove even if the result isn't used).

So it's certainly a valid optimization to know that the arguments aren't
even evaluated, and thus it's sometimes really wrong to change a macro
into an inline function.

Linus
-
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: 2009-11-18 23:46    [W:0.075 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site