[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 02/21] coccinelle: misc: Add secs_to_jiffies script
- To: eahariha@xxxxxxxxxxxxxxxxxxx
- From: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
- Date: Sat, 16 Nov 2024 07:05:40 +0100
- Cc: James.Bottomley@xxxxxxxxxxxxxxxxxxxxx, Julia.Lawall@xxxxxxxx, agordeev@xxxxxxxxxxxxx, airlied@xxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, andrew+netdev@xxxxxxx, anna-maria@xxxxxxxxxxxxx, ath11k@xxxxxxxxxxxxxxxxxxx, axboe@xxxxxxxxx, bcm-kernel-feedback-list@xxxxxxxxxxxx, borntraeger@xxxxxxxxxxxxx, catalin.marinas@xxxxxxx, ceph-devel@xxxxxxxxxxxxxxx, christian.gmeiner@xxxxxxxxx, christophe.leroy@xxxxxxxxxx, cocci@xxxxxxxx, coreteam@xxxxxxxxxxxxx, daniel@xxxxxxxxxx, davem@xxxxxxxxxxxxx, dick.kennedy@xxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, edumazet@xxxxxxxxxx, etnaviv@xxxxxxxxxxxxxxxxxxxxx, florian.fainelli@xxxxxxxxxxxx, gor@xxxxxxxxxxxxx, gregkh@xxxxxxxxxxxxxxxxxxx, haojian.zhuang@xxxxxxxxx, hca@xxxxxxxxxxxxx, horms@xxxxxxxxxx, idryomov@xxxxxxxxx, intel-xe@xxxxxxxxxxxxxxxxxxxxx, james.smart@xxxxxxxxxxxx, jeroendb@xxxxxxxxxx, jikos@xxxxxxxxxx, jinpu.wang@xxxxxxxxxxxxxxx, jjohnson@xxxxxxxxxx, joe.lawrence@xxxxxxxxxx, johan.hedberg@xxxxxxxxx, jpoimboe@xxxxxxxxxx, kadlec@xxxxxxxxxxxxx, kuba@xxxxxxxxxx, kvalo@xxxxxxxxxx, l.stach@xxxxxxxxxxxxxx, linux+etnaviv@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-bluetooth@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, linux-rpi-kernel@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, linux-sound@xxxxxxxxxxxxxxx, linux-staging@xxxxxxxxxxxxxxx, linux-wireless@xxxxxxxxxxxxxxx, linux@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, live-patching@xxxxxxxxxxxxxxx, louis.peens@xxxxxxxxxxxx, lucas.demarchi@xxxxxxxxx, luiz.dentz@xxxxxxxxx, maarten.lankhorst@xxxxxxxxxxxxxxx, maddy@xxxxxxxxxxxxx, marcel@xxxxxxxxxxxx, martin.petersen@xxxxxxxxxx, mbenes@xxxxxxx, mpe@xxxxxxxxxxxxxx, mripard@xxxxxxxxxx, naveen@xxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, nicolas.palix@xxxxxxx, npiggin@xxxxxxxxx, obitton@xxxxxxxxx, ogabbay@xxxxxxxxxx, oss-drivers@xxxxxxxxxxxx, pabeni@xxxxxxxxxx, pablo@xxxxxxxxxxxxx, perex@xxxxxxxx, pkaligineedi@xxxxxxxxxx, pmladek@xxxxxxxx, rjui@xxxxxxxxxxxx, robert.jarzmik@xxxxxxx, rodrigo.vivi@xxxxxxxxx, roger.pau@xxxxxxxxxx, sbranden@xxxxxxxxxxxx, shailend@xxxxxxxxxx, simona@xxxxxxxx, svens@xxxxxxxxxxxxx, thomas.hellstrom@xxxxxxxxxxxxxxx, tiwai@xxxxxxxx, tzimmermann@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, xiubli@xxxxxxxxxx
- Delivery-date: Sat, 16 Nov 2024 06:06:27 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Le 15/11/2024 à 22:26, Easwar Hariharan a écrit :
> Suggested-by: Anna-Maria Behnsen <anna-maria@xxxxxxxxxxxxx>
> Signed-off-by: Easwar Hariharan <eahariha@xxxxxxxxxxxxxxxxxxx>
> ---
> 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)
>
Hi,
@@ constant C =~ "000"; @@
* msecs_to_jiffies(C)
also spots things like msecs_to_jiffies(1000)
I'm not sure that coccinelle is enable to capture part of the regex to automate
the removal of the 000 when converting from ms to s.
Just my 2c,
CJ
|