From: Takashi Iwai Date: Wed, 16 May 2018 18:07:18 +0000 (+0200) Subject: ALSA: usb-audio: Apply rate limit to warning messages in URB complete callback X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=25436aa5c184b93e364c9c97d754f71725be1179;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ALSA: usb-audio: Apply rate limit to warning messages in URB complete callback [ Upstream commit 377a879d9832f4ba69bd6a1fc996bb4181b1e504 ] retire_capture_urb() may print warning messages when the given URB doesn't align, and this may flood the system log easily. Put the rate limit to the message for avoiding it. Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1093485 Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 3cbfae6604f9..d8a46d46bcd2 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -1311,7 +1311,7 @@ static void retire_capture_urb(struct snd_usb_substream *subs, if (bytes % (runtime->sample_bits >> 3) != 0) { int oldbytes = bytes; bytes = frames * stride; - dev_warn(&subs->dev->dev, + dev_warn_ratelimited(&subs->dev->dev, "Corrected urb data len. %d->%d\n", oldbytes, bytes); }