[cocci] [PATCH v2 02/21] coccinelle: misc: Add secs_to_jiffies script
Markus Elfring
Markus.Elfring at web.de
Sat Nov 16 21:23:01 AEDT 2024
Why is a change description missing here?
…
> +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
> @@ -0,0 +1,21 @@
…
> +/// Find usages of:
> +/// - msecs_to_jiffies(value*1000)
> +/// - msecs_to_jiffies(value*MSEC_PER_SEC)
I suggest to take another look at corresponding development documentation.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/dev-tools/coccinelle.rst?h=v6.12-rc7#n71
Will the attention grow for the proper usage of operation modes
according to the tool “coccicheck”?
…
> +// Copyright: (C) 2024 Easwar Hariharan Microsoft
Should personal details and company names be better distinguished in such information?
> +//
> +// Keywords: secs, seconds, jiffies
May a (blank) comment line be omitted here?
> +@@ constant C; @@
> +
> +- msecs_to_jiffies(C * 1000)
> ++ secs_to_jiffies(C)
> +
> +@@ constant C; @@
> +
> +- msecs_to_jiffies(C * MSEC_PER_SEC)
> ++ secs_to_jiffies(C)
I suggest to take a SmPL code variant (like the following)
better into account.
@depends on patch@
constant C;
@@
-msecs_to_jiffies
+secs_to_jiffies
(C
- * \( 1000 \| MSEC_PER_SEC \)
)
Can any expressions become relevant besides “constants”?
Regards,
Markus
More information about the Linuxppc-dev
mailing list