From patchwork Fri Nov 15 21:26:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13877124 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7617BD68BE1 for ; Fri, 15 Nov 2024 21:26:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0EAA08D0005; Fri, 15 Nov 2024 16:26:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F3FCF8D0001; Fri, 15 Nov 2024 16:26:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1D378D0006; Fri, 15 Nov 2024 16:26:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id A37508D0001 for ; Fri, 15 Nov 2024 16:26:44 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 5541DC02BF for ; Fri, 15 Nov 2024 21:26:44 +0000 (UTC) X-FDA: 82789613466.28.D41D375 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by imf04.hostedemail.com (Postfix) with ESMTP id 9252A4001C for ; Fri, 15 Nov 2024 21:25:44 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b="U/gvH0lz"; spf=pass (imf04.hostedemail.com: domain of eahariha@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=eahariha@linux.microsoft.com; dmarc=pass (policy=none) header.from=linux.microsoft.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731705764; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mjGmNlPTDeXtBIVnBruZVxnncRcSbkg/ti9M5w2fu78=; b=sS66wG14GnVrK+ZXFlQ1+fDldnbZHB058KA4DmacPwWwNbvvaey6miEz3nv0hZJqg9eh0S t7ueUZZVA+g5mwtuEjrhMbcY2lLmYfzz5TqCPUx8/XZvgoqHqUp/bPrX1Q5exsLn35S+PG VMfDRb5RIXx5uCYDYeBW381t2IcVFTs= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b="U/gvH0lz"; spf=pass (imf04.hostedemail.com: domain of eahariha@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=eahariha@linux.microsoft.com; dmarc=pass (policy=none) header.from=linux.microsoft.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731705764; a=rsa-sha256; cv=none; b=ijW2sU75AryOUs9IYcR4jOh/1IvrBGFSJKcEQ1DCHRcVFcmq2cdcW624dX7c7rBGT7R9AW GnRMxDoVh4gQinLb+pz8G5BHryhglbEfSA4mxpv0qUPSNb8cJo4Rfk4Z2Dth+d6XoI1Hdb wnt6pUVU96ejvqDRlJmt94b5/oFeB4I= Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 669E7206BCF5; Fri, 15 Nov 2024 13:26:41 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 669E7206BCF5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1731706001; bh=mjGmNlPTDeXtBIVnBruZVxnncRcSbkg/ti9M5w2fu78=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=U/gvH0lzaLER5CbzPB6zD06w9Keq1U18T2/iQ93vXhu6AQN4lJ3/X3Ps8tBq+V9hU 8JfV3K4VKfGl26W2AQ+6bKbYPc1Tg7Mcqod+tAQYKeaUhj6tHi9CdVz4KsBV+7LMZi VJMS6VhHAm7J/udfK+gDmWasBhF364IpIQjqUPkc= From: Easwar Hariharan Date: Fri, 15 Nov 2024 21:26:19 +0000 Subject: [PATCH v2 02/21] coccinelle: misc: Add secs_to_jiffies script MIME-Version: 1.0 Message-Id: <20241115-converge-secs-to-jiffies-v2-2-911fb7595e79@linux.microsoft.com> References: <20241115-converge-secs-to-jiffies-v2-0-911fb7595e79@linux.microsoft.com> In-Reply-To: <20241115-converge-secs-to-jiffies-v2-0-911fb7595e79@linux.microsoft.com> To: Pablo Neira Ayuso , Jozsef Kadlecsik , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Julia Lawall , Nicolas Palix , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Ofir Bitton , Oded Gabbay , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6?= =?utf-8?q?m?= , Rodrigo Vivi , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Jeroen de Borst , Praveen Kaligineedi , Shailend Chand , Andrew Lunn , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , =?utf-8?q?Roger_Pau_Mon?= =?utf-8?q?n=C3=A9?= , Jens Axboe , Kalle Valo , Jeff Johnson , Catalin Marinas , Andrew Morton , Jack Wang , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Xiubo Li , Ilya Dryomov , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Jaroslav Kysela , Takashi Iwai , Lucas Stach , Russell King , Christian Gmeiner , Louis Peens , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Madhavan Srinivasan Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, cocci@inria.fr, linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org, linux-scsi@vger.kernel.org, xen-devel@lists.xenproject.org, linux-block@vger.kernel.org, linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, linux-mm@kvack.org, linux-bluetooth@vger.kernel.org, linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, ceph-devel@vger.kernel.org, live-patching@vger.kernel.org, linux-sound@vger.kernel.org, etnaviv@lists.freedesktop.org, oss-drivers@corigine.com, linuxppc-dev@lists.ozlabs.org, Anna-Maria Behnsen , Easwar Hariharan X-Mailer: b4 0.14.2 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 9252A4001C X-Stat-Signature: qu8m564k5rop7ufgzypbisa1n4wexhn4 X-Rspam-User: X-HE-Tag: 1731705944-79408 X-HE-Meta: U2FsdGVkX19N2OXTw+e28UxecQRgzCvckxiJROnsrCnbS8z/ViUCemUciOxrJrbKlebqfAOD8fjht736GFnvI31+VYh3kbucACPaqGi/5GUN7BwWTzNon8vkQsbjhcdsrCNv5Qd1x5eeKajChTCBAXzHe7cF2HAUytcR4TniRJfzm5J7AwxxXG3MltNF0bkpftrZVs1iQm9ro/VL9LjGjwbbbxFPaHEKWkRcwjBMM+LHarsArcwI6XMle/597mew5ELyX0vTjQ67Tvq1mjcTPB+tffkz+Leeb7aIcUOLZ2onX/6tA60S5BkaYFc/2g62uS9n9/CZqkKWAqcnqTZve5YkWRTTbSoSayXFMC6lfhZY90kGArPwSjiaq+vT9qzcHPK1D/K84N0TNee5VxJ8LQGJScmswo9y1QXfPTouF08pyKM3QuSAIzW4JUFb8JcYq58djJKkCU6KJ0nGg1N2Ef7jt9Ne9/nGUnfksxK0ZXo8q0OiVGmLMJQ1pKYi1znfASUwrDjlU5vtDEaOaf7hMgJzST7e0C12yeHaVgbY4L9P1a7UsMWhQ7AXYmT6dDx3SSx2V8F31BZHFCBYqr+4tcaBn0rF8a1+w7kVBUmMcJKgFh5VR7P7udp6EXYXPl62umwXVvhBAGoCoelnYx9ejjJkkwYtt9aZmEyE6JaGjtuc1yuCjw+NUX36t+LzxutVEN0fpZfq8DZwU06fSIn+I7hc2pCPLvIOCNvdXXTKwgW1b5furQ2g5v65IS3Nk/miNv+CwV98p/FoKOCvNmlZW/fIs13P78Qmcf9y2cqr65Rd2hgumJ6IxAJhJvcdMezehjXIw8z9/zBxYcDRAuo0htIFh5JJNn3kbRYnva8qolSKXXHoelz4j0YglOjNtZlHIiGx7hpWo684RvTMIjGLTHJjndxTHnmqT5He0S28E7oR2hHrybNvpFWhAikQkzG07eGFvAIrvuAWCSg2SZF apWCK9F5 gBFMSFpvNeVtE/5sSYIkE9jnhm8n0VX7wVASMZe1X5N1J3tdND+BqkfeX2LFB7HkLr5QfZqjfCz3aOhbVflcFMMamo8gTJMSq7FwLmLCWj2bZ+3K+g+en5EpdVLFFI7F4/rAqlOnSTot6hojHmRmVKGag6cHR04pGNInzOJRFagyUb4WhrIJXfiNh0WOiasC0H0hkVzvKO+NM21mUy8HACammvOSnvusz1sg43Wd9cnWTj5gsqmTugP5m17znKuQ8dowpwLI75ggMBnBUNz9t4uSinPyakhJ/fTqYy/hyASABQmG9QIeeUMa24VOIlP+N3F9EAnW8rjCimWU872vIHCxXrk2Z9OFrJ8DnXP7rM3L+LeJ3lT7Nkm8jhmiQL9Y2mFWX3aaioV+GYBAzx3V4eFoUp2aWlKv8nvSNELknbpZSKaj4hGgDCIZQig3bYRYrZOJi X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Suggested-by: Anna-Maria Behnsen Signed-off-by: Easwar Hariharan --- scripts/coccinelle/misc/secs_to_jiffies.cocci | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/coccinelle/misc/secs_to_jiffies.cocci b/scripts/coccinelle/misc/secs_to_jiffies.cocci new file mode 100644 index 0000000000000000000000000000000000000000..af762b1c0aac8f044f21150bfaafd9efc834ee87 --- /dev/null +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-only +/// +/// Find usages of: +/// - msecs_to_jiffies(value*1000) +/// - msecs_to_jiffies(value*MSEC_PER_SEC) +/// +// Confidence: High +// Copyright: (C) 2024 Easwar Hariharan Microsoft +// +// Keywords: secs, seconds, jiffies +// + +@@ constant C; @@ + +- msecs_to_jiffies(C * 1000) ++ secs_to_jiffies(C) + +@@ constant C; @@ + +- msecs_to_jiffies(C * MSEC_PER_SEC) ++ secs_to_jiffies(C)