From: Felipe Balbi <felipe.balbi@nokia.com>
To: ext Kevin Hilman <khilman@deeprootsystems.com>
Cc: "Kristo Tero (Nokia-D/Tampere)" <Tero.Kristo@nokia.com>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] Smartreflex: Avoid unnecessary spam
Date: Thu, 10 Dec 2009 01:23:09 +0200 [thread overview]
Message-ID: <20091209232309.GA9514@nokia.com> (raw)
In-Reply-To: <87y6lbsprl.fsf@deeprootsystems.com>
On Thu, Dec 10, 2009 at 12:15:26AM +0100, ext Kevin Hilman wrote:
>Tero Kristo <tero.kristo@nokia.com> writes:
>
>> From: Tero Kristo <tero.kristo@nokia.com>
>>
>> Current warning messages will be constantly printed out during normal operation
>> if smartreflex autocompensation is disabled.
>>
>> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
>
>Agreed that these warnings are spam, but I think they should be
>replaced by some one-time warning so at least there's a hint someplace
>that SR is not actually being done on a platfrom.
well, there's printk_once()
include/linux/kernel.h:
250 /*
251 * Print a one-time message (analogous to WARN_ONCE() et al):
252 */
253 #define printk_once(x...) ({ \
254 static bool __print_once = true; \
255 \
256 if (__print_once) { \
257 __print_once = false; \
258 printk(x); \
259 } \
260 })
and WARN_ONCE()
include/asm-generic/bug.h:
125 #define WARN_ONCE(condition, format...) ({ \
126 static int __warned; \
127 int __ret_warn_once = !!(condition); \
128 \
129 if (unlikely(__ret_warn_once)) \
130 if (WARN(!__warned, format)) \
131 __warned = 1; \
132 unlikely(__ret_warn_once); \
133 })
I guess printk_once() is better.
--
balbi
next prev parent reply other threads:[~2009-12-09 23:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-08 14:16 [PATCH] Smartreflex: Avoid unnecessary spam Tero Kristo
2009-12-09 23:15 ` Kevin Hilman
2009-12-09 23:21 ` Nishanth Menon
2009-12-09 23:23 ` Felipe Balbi [this message]
2009-12-09 23:47 ` Nishanth Menon
2009-12-09 23:51 ` Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091209232309.GA9514@nokia.com \
--to=felipe.balbi@nokia.com \
--cc=Tero.Kristo@nokia.com \
--cc=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox