Re: [PATCH] Smartreflex: Avoid unnecessary spam

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

 



On Thu, Dec 10, 2009 at 12:15:26AM +0100, ext Kevin Hilman wrote:
Tero Kristo <tero.kristo@xxxxxxxxx> writes:

From: Tero Kristo <tero.kristo@xxxxxxxxx>

Current warning messages will be constantly printed out during normal operation
if smartreflex autocompensation is disabled.

Signed-off-by: Tero Kristo <tero.kristo@xxxxxxxxx>

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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux