aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/coccinelle/misc/secs_to_jiffies.cocci
blob: 416f348174ca659b544441f5f68f04a41d1ad4a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// 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
//

virtual patch

@depends on patch@ constant C; @@

- msecs_to_jiffies(C * 1000)
+ secs_to_jiffies(C)

@depends on patch@ constant C; @@

- msecs_to_jiffies(C * MSEC_PER_SEC)
+ secs_to_jiffies(C)

@depends on patch@ expression E; @@

- msecs_to_jiffies(E * 1000)
+ secs_to_jiffies(E)

@depends on patch@ expression E; @@

- msecs_to_jiffies(E * MSEC_PER_SEC)
+ secs_to_jiffies(E)