[PATCH] Staging: crystalhd: crystalhd_misc: improved debug macros

Dan Carpenter dan.carpenter at oracle.com
Wed Feb 15 06:40:59 UTC 2012


On Wed, Feb 15, 2012 at 12:20:06AM -0200, Jorgyano Vieira wrote:
> Improvement of debug macros to ensure safe use on if/else statements.
> 

How are the originals unsafe?  The changelog should say how this is
an improvement.  Something like "I put do { ... } while(0) around
the macros so it matches the rest of the kernel."

Really we want to get rid of these.  It would be easy to delete
BCMLOG_ENTER and BCMLOG_LEAVE right now.  They're only used for five
functions.  BCMLOG() is slightly complicated.  BCMLOG_ERR() could
be sed replaced with pr_err().

So could you do that instead?  Send a patch to remove BCMLOG_ENTER
and BCMLOG_LEAVE?  Then send another patch to replace BCMLOG_ERR()
with pr_err().  Take a look at how the pr_fmt macro is used for
this.  Don't actually do it with sed.  Take the time and review each
printk() and notice bugs as you go along.  You could replace them
file by file if you wanted or all at once, which ever is easier for
you.  Then send a third patch to add the do {} while(0) block to
BCMLOG() until someone works up enough motivation to fix it
properly?

regards,
dan carpenter



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20120215/7ea2ebc1/attachment.asc>


More information about the devel mailing list