Thread (62 messages) 62 messages, 18 authors, 2024-12-09
STALE537d
Revisions (4)
  1. v1 [diff vs current]
  2. v2 current
  3. v3 [diff vs current]
  4. v4 [diff vs current]

[PATCH v2 02/21] coccinelle: misc: Add secs_to_jiffies script

From: Easwar Hariharan <hidden>
Date: 2024-11-15 21:26:42
Also in: ath11k, ceph-devel, cocci, dri-devel, intel-xe, linux-block, linux-bluetooth, linux-mm, linux-s390, linux-scsi, linux-sound, linux-staging, linux-wireless, linuxppc-dev, live-patching, lkml, netfilter-devel, xen-devel
Subsystem: coccinelle/semantic patches (smpl), the rest · Maintainers: Julia Lawall, Nicolas Palix, Linus Torvalds

Suggested-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Easwar Hariharan <redacted>
---
 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)
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help