Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1709853rdh; Fri, 24 Nov 2023 23:38:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxQsRfvAQ47+0JzUCvzqBbUQIZC6gcUZeVJF6HBTNwFjDRT0Yqd27iCFdv9Jg7rpC4NS/L X-Received: by 2002:a05:6808:1114:b0:3ad:fe8d:dfae with SMTP id e20-20020a056808111400b003adfe8ddfaemr4270916oih.57.1700897897775; Fri, 24 Nov 2023 23:38:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700897897; cv=none; d=google.com; s=arc-20160816; b=FAKjKV8yTd2RSGEPGRma7EYnpt3I0fGcaSc6iIZOfsC2+cmQ+zq0r1BjKohJF9vdci cAf73Ris3MQ5jVCPg/c068CbsOMGGy8Scm8bMvPin6PYRedMV3Uu+fRYZEkeZRJr6dry KkgzZFZlV6qkMt1UVo7JPcCC9fUirFJcFddCVAcUJ1sAA1+AA4XCDHA3cyFcootL/Ua8 jdihzAR0vLmBB5P8OZ1GtOMJF0/UBSaGiALPHQ9Nu3fTLu56OTHyxj1nU2x9nfOg6+Ql D2t/CswPeD0Sr8tLojhdQUyJIubyv1OYMGwZNtm2YN8zedgsaENSxG/ihQpY0bGiKYr/ Di0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=S4JkLSQxu72A0kXiJvpqBGPzheBm60khT4FXTWA7Mes=; fh=WRPwVYl6K9eWXDBgytFweu2KzxiLB2k1AOjiewQnEDE=; b=m28jlC2aWxFMv0N8C/sukWhMYzNyyi5LuIbEwjM4tC0wytrIx5jeBtdevkCotq93s7 GX961d1rXevBAYCe9HPrw4Y4XsRXiA0VskCBC9OmQiYdofb7nangEfn2G+UBMfs2FmXA 7jXTLD02HAwKyuz78yEahdy/+Jqmn++nVXfYIgF8uMfC1A/HQ3nKSpNo8Xj6ypqjr40Z 9+27WicJmAL7Lgsv3/wrhcgDYqeMPOmm3m7/FTw1Pq3+sfAmVW2bJA23NZ1v8aur3EId tweyT1Q7DTCxfGS259lShPc1BSbHUoPK+Fg2yDSume1BDJRcLuBfNQl7LFZULrGQfgOt GEPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="m/0jWPiI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id be7-20020a656e47000000b005c2193952a3si5529723pgb.239.2023.11.24.23.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 23:38:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="m/0jWPiI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5893580B2315; Fri, 24 Nov 2023 23:38:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229462AbjKYHiF (ORCPT + 99 others); Sat, 25 Nov 2023 02:38:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjKYHiD (ORCPT ); Sat, 25 Nov 2023 02:38:03 -0500 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2402510F4; Fri, 24 Nov 2023 23:38:09 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6c4eb5fda3cso2505110b3a.2; Fri, 24 Nov 2023 23:38:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700897888; x=1701502688; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=S4JkLSQxu72A0kXiJvpqBGPzheBm60khT4FXTWA7Mes=; b=m/0jWPiIiT1caqQE0pv/LeDSjzItgUW8EabCfZtGmdAU5XVIxti09bihW+oJ5lNqla sPbXXXShVPWouzXy/wieZi4r6vq9Xum9OLekOcky4eaPaHRzySJu2lcDxRQ09C/CgIOQ NDU3741oDlMbXQkKNDISOVUlSOD2YqoLwR8SOyYxIz2gI9u9gvy+cmWo2M227YoZrKqn kcgEQDzWX6bGnsBmg+fec8kLSwImNLi4pGqeJEiCcsUCT42GQqq4xzbR1wVgFnSn/1HN 30iA+RjRQMk3e8qEYd6KNEKcG1rB86NJ1hVA7ryDHtPPLzvUpqpQJ4i7w79hphkNnh/D fXVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700897888; x=1701502688; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=S4JkLSQxu72A0kXiJvpqBGPzheBm60khT4FXTWA7Mes=; b=NmvWLNBW+RwEIrqVG5WbJUwhWfIxHYsW7i4AAkMnMP67+lrF7k5jo/uu4gAQoG4YP0 n2paUCnDESe6xDA/OrOWus6Hrcc6EEIb0dP0La0/wv+4xUz7OfV5rHUbMlPb19PAQWU6 A09aFi4JwpumJRyy31LKXpc4FXNksp91GyYZeXtmgYYvZPzYBrxepw665/71MjoMtiZH 7hftnfhBPt5KHVXOEzvydj/BtdoNxIV+eKVfum1C6qS96pj40wuslksQwIj3vPkPfkcQ tkQVVddhjg+Ufy9e+bMuLzhQ7fJsG1KclIwCYj8+t4ijuycRnvGleIWG/qiCUCqk02id M3tQ== X-Gm-Message-State: AOJu0YyUdT0Wg4d2ShxJ2yI7G/jiIF4qo5D1nzcIgSEwZOsCSegqrZdY C/c3J/OVZvl+i6uEfXHls68= X-Received: by 2002:a05:6a00:e0f:b0:6cb:d2cb:5234 with SMTP id bq15-20020a056a000e0f00b006cbd2cb5234mr6181755pfb.32.1700897888435; Fri, 24 Nov 2023 23:38:08 -0800 (PST) Received: from localhost.localdomain ([2401:4900:716a:b035:3f6f:ef07:d897:b98e]) by smtp.gmail.com with ESMTPSA id j7-20020a62e907000000b0069323619f69sm3911981pfh.143.2023.11.24.23.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 23:38:08 -0800 (PST) From: Ghanshyam Agrawal To: ezequiel@vanguardiasur.com.ar, mchehab@kernel.org Cc: Ghanshyam Agrawal , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Phillip Potter Subject: [PATCH V3] media: stk1160: Fixed high volume of stk1160_dbg messages Date: Sat, 25 Nov 2023 13:07:38 +0530 Message-Id: <20231125073738.649948-1-ghanshyam1898@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 24 Nov 2023 23:38:16 -0800 (PST) The function stk1160_dbg gets called too many times, which causes the output to get flooded with messages. Since stk1160_dbg uses printk, it is now replaced with printk_ratelimited directly. Suggested-by: Phillip Potter Signed-off-by: Ghanshyam Agrawal --- V3: Fixed the issue with my patch needing previous versions being applied first. Used printk_ratelimited instead of dev_warn_ratelimited because of compiler error "incompatible pointer type". V2: To add KERN_WARNING in printk_ratelimited, and later as per warning by the checkpatch script, replaced printk_ratelimited with dev_warn_ratelimited. V1: The function stk1160_dbg gets called too many times, which causes the output to get flooded with messages. Since stk1160_dbg uses printk, it is now replaced with dev_warn_ratelimited. drivers/media/usb/stk1160/stk1160-video.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/stk1160/stk1160-video.c b/drivers/media/usb/stk1160/stk1160-video.c index 4e966f6bf608..98417fa31d70 100644 --- a/drivers/media/usb/stk1160/stk1160-video.c +++ b/drivers/media/usb/stk1160/stk1160-video.c @@ -107,8 +107,7 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len) /* * TODO: These stk1160_dbg are very spammy! - * We should 1) check why we are getting them - * and 2) add ratelimit. + * We should check why we are getting them. * * UPDATE: One of the reasons (the only one?) for getting these * is incorrect standard (mismatch between expected and configured). @@ -151,7 +150,7 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len) /* Let the bug hunt begin! sanity checks! */ if (lencopy < 0) { - stk1160_dbg("copy skipped: negative lencopy\n"); + printk_ratelimited(KERN_WARNING "copy skipped: negative lencopy\n"); return; } -- 2.25.1