lkml.org 
[lkml]   [2011]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tmio_mmc: Improve readability of the output of pr_debug_status()
On Fri, Feb 04, 2011 at 08:34:54PM +0100, Guennadi Liakhovetski wrote:
> On Fri, 4 Feb 2011, Simon Horman wrote:
>
> > Signed-off-by: Simon Horman <horms@verge.net.au>
> > ---
> > drivers/mmc/host/tmio_mmc.h | 6 +++++-
> > 1 files changed, 5 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
> > index 6f724de..811427d 100644
> > --- a/drivers/mmc/host/tmio_mmc.h
> > +++ b/drivers/mmc/host/tmio_mmc.h
> > @@ -237,12 +237,16 @@ static inline void tmio_mmc_kunmap_atomic(void *virt,
> >
> > #define STATUS_TO_TEXT(a) \
> > do { \
> > - if (status & TMIO_STAT_##a) \
> > + if (status & TMIO_STAT_##a) { \
> > + if (i++) \
> > + printk("|"); \
> > printk(#a); \
> > + } \
>
> Personally, I find it a bad idea to use variables in macros without
> explicitly passing them in the parameter list. Yes, this macro is already
> using "status" in that way, still, I don't think, that adding more such
> variables is good. Why not make it STATUS_TO_TEXT(a, status, i) and also
> add spaces for better yet readability like printk(" | ")?

Point taken, I will send v2 shortly.
Though the STATUS_TO_TEXT(a, status, i) change
does seem to make pr_debug_status() rather a lot noisier.



\
 
 \ /
  Last update: 2011-02-04 22:43    [W:0.035 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site