Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2255404rdh; Sun, 29 Oct 2023 07:37:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6xidFw8EA2BUm9uMadYbZucgmiWB4ByIXAof1oHsf29hWlGBB404zcDxlj8uspKF+G42P X-Received: by 2002:a05:6a20:4406:b0:153:a461:d96e with SMTP id ce6-20020a056a20440600b00153a461d96emr8028525pzb.47.1698590220345; Sun, 29 Oct 2023 07:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698590220; cv=none; d=google.com; s=arc-20160816; b=Kdrp4zCWzZ2Xv9CU4V4Xq1mmrxc4xha75El9WypEx4BYoec/+EYODMPsrwXFK8eCEm hB7RjTiKmx2KsZ8DwoDehcKKom4qyK4sCYWXaMS95aXq9JZgQPICGvaBGgokgZjXdTH5 FRqe3xq7GyVO/vs8l3nXyyJW4l1q0F9NDNyjy1bmwX/wfNPpSNGLnZsUI01xFl3EsVto 3IRymZNgML+6nyNhIsioMvO3oaXo01PpFAxZn0UZ4lMAmGUZLQQspywzVY89imvQrVTM 3ifM28fWiwcBBRgTKmT4I8mf12vOKIho6sIHnAQnA8C4yywO8kQ1H+xQKSz3zMnfvMJg Dmxg== 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=WOotfpE7UygG9u+jO7okxXpuJl/dpW05Sd73/FzJiB0=; fh=NlYsKs/S1b9zhCtJ6M7bKJOICpQZkWPNYmQvKeQcClg=; b=AfGUesqPmz8gBa8jY8sNCgSQLUoUYa9EuGtPu/ea5A0O6JsVhAgFVDLFaV5LxZSmPg Jo/zKV+MJWV+el2bZ43ZIRVctmaiUPeyw4zO4sLBeqjV1cSEJDhHSlZwK8qVbs0hW/bn Lt+Vcc9taiDoRyV8yznwUTsyvCE8e/Edc82zv0wLTuzXkEivDYRWHFODUNhgiwvcXdlP W1QCmMNh1VeOf18uDoErsC5VJaR+0nttdEe89yAMIPXkN1lV8qKpLuHDf3VQhWGUnnmC 6z5fDQV8JV1RDcRxUqOPoHDt4XmhAAt7SSiksJvPplJPvCWF6Sd8nNDsEk3IpplODIsi xJqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GsP8ePen; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id i20-20020a17090adc1400b002791b907f0csi1338910pjv.121.2023.10.29.07.36.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 07:37:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GsP8ePen; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 5819580907A8; Sun, 29 Oct 2023 07:36:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230121AbjJ2Og1 (ORCPT + 99 others); Sun, 29 Oct 2023 10:36:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjJ2OgZ (ORCPT ); Sun, 29 Oct 2023 10:36:25 -0400 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06873B8; Sun, 29 Oct 2023 07:36:23 -0700 (PDT) Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-7a6907e9aa8so127728039f.1; Sun, 29 Oct 2023 07:36:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698590182; x=1699194982; 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=WOotfpE7UygG9u+jO7okxXpuJl/dpW05Sd73/FzJiB0=; b=GsP8ePenkX41jxjMPSbzMExd805XG+5rREld9+lvJduoYj+QzuzsbnqGmA3H3uKBws w7/BoMhALV6Fmg2oG1dT7CZ5/D6vQWE151Phj1ycxu9yNEYyk7jlGSLa8D/BuAmythuZ 6pwPensPYxlwrjZty9bOmRTnNeE0h8dO70Lt5OShNn4c1kBwuOTE09WeqTNRrybduoXH zy0yBXuuImmQ/faSYrr0lhTJg00eUqOVJTyJBot/es5OJ2QDarEFA0WHYWf48faQI/Xr R5QAikwDahEFT8W9dE5wcZQbLnYWOo711nlHirS/w65u0ljui4GC/LPbH+raV1f0553P ISmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698590182; x=1699194982; 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=WOotfpE7UygG9u+jO7okxXpuJl/dpW05Sd73/FzJiB0=; b=k/D+q2Id7wFfEUenp7OCx+GvDI7anA2RnB340MXvBq/vL02seJnw052vYWohsc/vf4 fN61YUVPar0nWJu95cMEbQw7ps9/iSpXGKqrdO4CBIWb92nZyl8kyUlOAvvkTmlBGo86 WoQXt8GhT63ZeYipKluwCo2a7VZsqKnFO8xnF5Fea0VHxMwiRPAARW75eJ0AhRYli9Qb a2DXrc3W3vjtVCVSmP9bkc85gq8diynQksqcJ16d72scsRXaZOdid+oWiUDxs/YYWi50 dNpRjv8xK/JmQ82cny0uAGV56sq6m73DcWHo4gCAnnxfwwgOe/C9dsNyMj5jP/ghwLzI 3nrA== X-Gm-Message-State: AOJu0YxchG3WRWO/npFMz/Cs3SRC4rQ+4fMXW2MKauab2uFL8Cvn5mtz PHTgOcYFsDV/sFkrZaAayo4= X-Received: by 2002:a92:cdaf:0:b0:357:600c:7c5f with SMTP id g15-20020a92cdaf000000b00357600c7c5fmr10083288ild.23.1698590182261; Sun, 29 Oct 2023 07:36:22 -0700 (PDT) Received: from localhost.localdomain ([202.137.218.21]) by smtp.gmail.com with ESMTPSA id a26-20020a63bd1a000000b005b8e1b0090asm3421348pgf.67.2023.10.29.07.36.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 07:36:22 -0700 (PDT) From: Ghanshyam Agrawal To: ezequiel@vanguardiasur.com.ar, mchehab@kernel.org Cc: Ghanshyam Agrawal , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: [PATCH] media: stk1160: Fixed high volume of stk1160_dbg messages Date: Sun, 29 Oct 2023 20:06:04 +0530 Message-Id: <20231029143604.120329-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=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Sun, 29 Oct 2023 07:36:53 -0700 (PDT) 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. Signed-off-by: Ghanshyam Agrawal --- drivers/media/usb/stk1160/stk1160-video.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/media/usb/stk1160/stk1160-video.c b/drivers/media/usb/stk1160/stk1160-video.c index 4e966f6bf608..f5b75f380c19 100644 --- a/drivers/media/usb/stk1160/stk1160-video.c +++ b/drivers/media/usb/stk1160/stk1160-video.c @@ -105,17 +105,6 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len) u8 *dst = buf->mem; int remain; - /* - * TODO: These stk1160_dbg are very spammy! - * We should 1) check why we are getting them - * and 2) add ratelimit. - * - * UPDATE: One of the reasons (the only one?) for getting these - * is incorrect standard (mismatch between expected and configured). - * So perhaps, we could add a counter for errors. When the counter - * reaches some value, we simply stop streaming. - */ - len -= 4; src += 4; @@ -151,7 +140,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("copy skipped: negative lencopy\n"); return; } -- 2.25.1