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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
|
|