lkml.org 
[lkml]   [2011]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 1/3] PM: Introduce DEVFREQ: generic DVFS framework with device-specific OPPs
Date
On Wednesday, May 18, 2011, Pavel Machek wrote:
> Hi!
>
> > > >> +#define dev_dbg_once(dev, fmt, ...) \
> > > >> + if (!once) { \
> > > >> + once = 1; \
> > > >> + dev_dbg(dev, pr_fmt(fmt), ##__VA_ARGS__); \
> > > >> + }
> > > >
> > > > Why do you need this?
> > > >
> > >
> > > This devfreq_do is going to be called periodically; thus, I want to
> > > print a message if there is an error, but not too many messages with
> > > the repeated calls.
> > >
> > > Besides, I'd change the macro like this:
> > >
> > > #define dev_dbg_once(dev, fmt, ...) \
> > > { \
> > > static int once; \
> > > if (!once) { \
> > > once = 1; \
> > > dev_dbg(dev, pr_fmt(fmt), ##__VA_ARGS__); \
> > > } \
> > > }
> > >
> > > so that "static int once;" in functions can be removed.
> >
> > That's a good change in my opinion, but since there is the dynamic debug
> > feature, I don't think you need to worry too much about that (the user
> > can always disable output from those dev_dbg() statements if they generate
> > too much noise).
>
> Well... we do print-once in other places, too. And that way, we can
> maybe enable those prints by default...

I'm not sure what you mean?

Rafael


\
 
 \ /
  Last update: 2011-05-18 22:31    [W:0.061 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site