From c3e982548c3e50aad68e0a0c2947f26970181a5c Mon Sep 17 00:00:00 2001 From: Aditya Bavanari Date: Tue, 7 May 2019 15:42:18 +0530 Subject: [PATCH] asoc: Ratelimit error logs to avoid excessive logging Ratelimit error logs of boundary check conditions in audio effects driver to avoid excessive logging. CRs-Fixed: 2426159 Change-Id: Iaf10eee281389773a21340997e3ffbe88c6e79f6 Signed-off-by: Aditya Bavanari --- .../soc/msm/qdsp6v2/msm-audio-effects-q6-v2.c | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/sound/soc/msm/qdsp6v2/msm-audio-effects-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-audio-effects-q6-v2.c index 1286d3185780..65fdec57d5ed 100644 --- a/sound/soc/msm/qdsp6v2/msm-audio-effects-q6-v2.c +++ b/sound/soc/msm/qdsp6v2/msm-audio-effects-q6-v2.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2017, 2019 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -22,7 +23,8 @@ #define GET_NEXT(ptr, upper_limit, rc) \ ({ \ if (((ptr) + 1) > (upper_limit)) { \ - pr_err("%s: param list out of boundary\n", __func__); \ + pr_err_ratelimited("%s: param list out of boundary\n", \ + __func__); \ (rc) = -EINVAL; \ } \ ((rc) == 0) ? *(ptr)++ : -EINVAL; \ @@ -31,7 +33,8 @@ #define CHECK_PARAM_LEN(len, max_len, tag, rc) \ do { \ if ((len) > (max_len)) { \ - pr_err("%s: params length overflows\n", (tag)); \ + pr_err_ratelimited("%s: params length overflows\n", \ + (tag)); \ (rc) = -EINVAL; \ } \ } while (0) @@ -251,7 +254,8 @@ int msm_audio_effects_virtualizer_handler(struct audio_client *ac, } break; default: - pr_err("%s: Invalid command to set config\n", __func__); + pr_err_ratelimited("%s: Invalid command to set config\n", + __func__); break; } } @@ -722,7 +726,8 @@ int msm_audio_effects_reverb_handler(struct audio_client *ac, } break; default: - pr_err("%s: Invalid command to set config\n", __func__); + pr_err_ratelimited("%s: Invalid command to set config\n", + __func__); break; } } @@ -858,7 +863,8 @@ int msm_audio_effects_bass_boost_handler(struct audio_client *ac, } break; default: - pr_err("%s: Invalid command to set config\n", __func__); + pr_err_ratelimited("%s: Invalid command to set config\n", + __func__); break; } } @@ -968,7 +974,8 @@ int msm_audio_effects_pbe_handler(struct audio_client *ac, } break; default: - pr_err("%s: Invalid command to set config\n", __func__); + pr_err_ratelimited("%s: Invalid command to set config\n", + __func__); break; } } @@ -1198,7 +1205,8 @@ int msm_audio_effects_popless_eq_handler(struct audio_client *ac, } break; default: - pr_err("%s: Invalid command to set config\n", __func__); + pr_err_ratelimited("%s: Invalid command to set config\n", + __func__); break; } } @@ -1354,7 +1362,7 @@ static int __msm_audio_effects_volume_handler(struct audio_client *ac, } break; default: - pr_err("%s: Invalid command id: %d to set config\n", + pr_err_ratelimited("%s: Invalid command id: %d to set config\n", __func__, command_id); break; }