aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorTim Gardner <tim.gardner@canonical.com>2013-08-16 13:18:59 -0400
committerTakashi Iwai <tiwai@suse.de>2013-08-19 09:48:33 -0400
commitbcbb15530ebe9737622cb7779b35c61f48b49734 (patch)
treef2080fe60461510df9287c6cb4ae8c6913d51f9f /include/sound
parentc841ad2a9b86c7317dc7e4fe4e03bc56a6c0d6e8 (diff)
ALSA: pcm: Add snd_printd_ratelimit()
Direct calls to printk_limit() will emit log noise even when CONFIG_SND_DEBUG is not defined. Add a wrapper macro around printk_limit() that is conditionally defined by CONFIG_SND_DEBUG. Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.de> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Yacine Belkadi <yacine.belkadi.1@gmail.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/core.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/sound/core.h b/include/sound/core.h
index c586617cfa0d..2a14f1f02d4f 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -27,6 +27,7 @@
27#include <linux/rwsem.h> /* struct rw_semaphore */ 27#include <linux/rwsem.h> /* struct rw_semaphore */
28#include <linux/pm.h> /* pm_message_t */ 28#include <linux/pm.h> /* pm_message_t */
29#include <linux/stringify.h> 29#include <linux/stringify.h>
30#include <linux/printk.h>
30 31
31/* number of supported soundcards */ 32/* number of supported soundcards */
32#ifdef CONFIG_SND_DYNAMIC_MINORS 33#ifdef CONFIG_SND_DYNAMIC_MINORS
@@ -376,6 +377,11 @@ void __snd_printk(unsigned int level, const char *file, int line,
376#define snd_BUG() WARN(1, "BUG?\n") 377#define snd_BUG() WARN(1, "BUG?\n")
377 378
378/** 379/**
380 * Suppress high rates of output when CONFIG_SND_DEBUG is enabled.
381 */
382#define snd_printd_ratelimit() printk_ratelimit()
383
384/**
379 * snd_BUG_ON - debugging check macro 385 * snd_BUG_ON - debugging check macro
380 * @cond: condition to evaluate 386 * @cond: condition to evaluate
381 * 387 *
@@ -398,6 +404,8 @@ static inline void _snd_printd(int level, const char *format, ...) {}
398 unlikely(__ret_warn_on); \ 404 unlikely(__ret_warn_on); \
399}) 405})
400 406
407static inline bool snd_printd_ratelimit(void) { return false; }
408
401#endif /* CONFIG_SND_DEBUG */ 409#endif /* CONFIG_SND_DEBUG */
402 410
403#ifdef CONFIG_SND_DEBUG_VERBOSE 411#ifdef CONFIG_SND_DEBUG_VERBOSE