a code reduction function addition to cam_xpt
Bruce Evans
bde at zeta.org.au
Mon Dec 4 21:27:27 PST 2006
On Mon, 4 Dec 2006, Ade Lovett wrote:
> On Dec 04, 2006, at 20:27 , mjacob at freebsd.org wrote:
>>> On Dec 04, 2006, at 19:27 , mjacob at freebsd.org wrote:
>>>> IOCCC?
>>>
>>> http://www.ioccc.org/
Or just google it.
>>> Consider this another vote for "function" ;)
>>
>> Bruce is usually less indirect. What gives?
You haven't talked to me enough :-).
> Multi-line #define's are 'orrible (IMO) -- of course, our tree is littered
> with them, but it's highly preferable to have a function over a define,
> particularly when it comes to reading the code n months later, trying to
> track something down. In this particular case, the minimal overhead of
> calling a function rather than having it inline (via #define) is vastly
> outweighed by code-readability, and reduction in kernel size.
And in many cases reducing the kernel size also reduces time due to it
reducing cache misses. Here I think the code is so rarely executed that
neither space or time efficiency really matters.
Bruce
More information about the freebsd-scsi
mailing list