Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750862Ab3HSNrw (ORCPT ); Mon, 19 Aug 2013 09:47:52 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34733 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750715Ab3HSNrv (ORCPT ); Mon, 19 Aug 2013 09:47:51 -0400 Date: Mon, 19 Aug 2013 15:49:39 +0200 Message-ID: From: Takashi Iwai To: Tim Gardner Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Jaroslav Kysela , Pierre-Louis Bossart , Lars-Peter Clausen , Yacine Belkadi Subject: Re: [PATCH 3.11-rc5 1/2] ALSA: pcm: Add snd_printd_ratelimit() In-Reply-To: <1376673540-2201-1-git-send-email-tim.gardner@canonical.com> References: <1376673540-2201-1-git-send-email-tim.gardner@canonical.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2363 Lines: 74 At Fri, 16 Aug 2013 11:18:59 -0600, Tim Gardner wrote: > > 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 > Cc: Takashi Iwai > Cc: Pierre-Louis Bossart > Cc: Lars-Peter Clausen > Cc: Yacine Belkadi > Signed-off-by: Tim Gardner > --- > > checkpatch is moaning about the use of printk_ratelimit(), but > printk_ratelimited() seems like overkill for a debug feature. > > WARNING: Prefer printk_ratelimited or pr__ratelimited to printk_ratelimit > #38: FILE: include/sound/core.h:382: > +#define snd_printd_ratelimit() printk_ratelimit() Thanks, applied both patches now. But it's no real bug, so I postpone this for 3.12 inclusion. Takashi > > include/sound/core.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/sound/core.h b/include/sound/core.h > index c586617..2a14f1f 100644 > --- a/include/sound/core.h > +++ b/include/sound/core.h > @@ -27,6 +27,7 @@ > #include /* struct rw_semaphore */ > #include /* pm_message_t */ > #include > +#include > > /* number of supported soundcards */ > #ifdef CONFIG_SND_DYNAMIC_MINORS > @@ -376,6 +377,11 @@ void __snd_printk(unsigned int level, const char *file, int line, > #define snd_BUG() WARN(1, "BUG?\n") > > /** > + * Suppress high rates of output when CONFIG_SND_DEBUG is enabled. > + */ > +#define snd_printd_ratelimit() printk_ratelimit() > + > +/** > * snd_BUG_ON - debugging check macro > * @cond: condition to evaluate > * > @@ -398,6 +404,8 @@ static inline void _snd_printd(int level, const char *format, ...) {} > unlikely(__ret_warn_on); \ > }) > > +static inline bool snd_printd_ratelimit(void) { return false; } > + > #endif /* CONFIG_SND_DEBUG */ > > #ifdef CONFIG_SND_DEBUG_VERBOSE > -- > 1.7.9.5 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/