RFC PATCH remove DIV_TO_REG in gl518sm.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 21 Mar 2005 10:10:24 +0100 (CET), "Jean Delvare" <khali at linux-fr.org> wrote:

>
>Hi Grant,
>
>The macro *is* in fact used, although the (ab)use of macros all over the
>place make it hard to see it the first place (grep can't help here).

Oops.  Sorry.
>
>Look at these two lines:
>
>set_bits(DIV, fan_div1, fan_div[0], GL518_REG_MISC, 0xc0, 6);
>set_bits(DIV, fan_div2, fan_div[1], GL518_REG_MISC, 0x30, 4);
>
>Climb up the preprocessing chain, and you'll see that the DIV_TO_REG
>macro is actually needed. You could have noticed by simply
>compile-testing your patch. I invite you to always do.

Which I forgot to do 'cos no see match. :(  Are there tools for 
this, I started writing something to get at preprocessor output 
but it seems to want a perl script to parse output of gcc -E.

Hmm, so if I'm not sure of something, comment it out and ask 
the compiler, get a line number or string to look for?  

>You just hit one of the various reasons why I prefer inline functions to
>macros when both are possible. At least the compiler keeps track of
>function users and will let you know the unused ones.

Thanks for feedback.  Perhaps I'll just go shooting macros 
to make the code a bit more obvious?

Cheers,
Grant.



[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux