Re: [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
- From: Easwar Hariharan <eahariha@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Jan 2025 21:05:58 -0800
- Cc: cocci@xxxxxxxx, eahariha@xxxxxxxxxxxxxxxxxxx, LKML <linux-kernel@xxxxxxxxxxxxxxx>, kernel-janitors@xxxxxxxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx, linux-ide@xxxxxxxxxxxxxxx, linux-nvme@xxxxxxxxxxxxxxxxxxx, linux-pm@xxxxxxxxxxxxxxx, linux-rdma@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, linux-sound@xxxxxxxxxxxxxxx, linux-spi@xxxxxxxxxxxxxxx, linux-xfs@xxxxxxxxxxxxxxx, ceph-devel@xxxxxxxxxxxxxxx, platform-driver-x86@xxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx, imx@xxxxxxxxxxxxxxx, kernel@xxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Carlos Maiolino <cem@xxxxxxxxxx>, Chris Mason <clm@xxxxxx>, Christoph Hellwig <hch@xxxxxx>, Damien Le Moal <dlemoal@xxxxxxxxxx>, "Darrick J. Wong" <djwong@xxxxxxxxxx>, David Sterba <dsterba@xxxxxxxx>, Dick Kennedy <dick.kennedy@xxxxxxxxxxxx>, Dongsheng Yang <dongsheng.yang@xxxxxxxxxxxx>, Fabio Estevam <festevam@xxxxxxxxx>, Frank Li <Frank.Li@xxxxxxx>, Hans de Goede <hdegoede@xxxxxxxxxx>, Henrique de Moraes Holschuh <hmh@xxxxxxxxxx>, James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, James Smart <james.smart@xxxxxxxxxxxx>, Jaroslav Kysela <perex@xxxxxxxx>, Jason Gunthorpe <jgg@xxxxxxxx>, Jens Axboe <axboe@xxxxxxxxx>, Josef Bacik <josef@xxxxxxxxxxxxxx>, Julia Lawall <Julia.Lawall@xxxxxxxx>, Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>, Ilya Dryomov <idryomov@xxxxxxxxx>, Kalesh Anakkur Purayil <kalesh-anakkur.purayil@xxxxxxxxxxxx>, Keith Busch <kbusch@xxxxxxxxxx>, Leon Romanovsky <leon@xxxxxxxxxx>, Mark Brown <broonie@xxxxxxxxxx>, "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>, Nicolas Palix <nicolas.palix@xxxxxxx>, Niklas Cassel <cassel@xxxxxxxxxx>, Oded Gabbay <ogabbay@xxxxxxxxxx>, Ricardo Ribalda <ribalda@xxxxxxxxxx>, Sagi Grimberg <sagi@xxxxxxxxxxx>, Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>, Sebastian Reichel <sre@xxxxxxxxxx>, Selvin Xavier <selvin.xavier@xxxxxxxxxxxx>, Shawn Guo <shawnguo@xxxxxxxxxx>, Shyam Sundar S K <Shyam-sundar.S-k@xxxxxxx>, Takashi Iwai <tiwai@xxxxxxxx>, Victor Gambier <victor.gambier@xxxxxxxx>, Xiubo Li <xiubli@xxxxxxxxxx>, Yaron Avizrat <yaron.avizrat@xxxxxxxxx>
- In-reply-to: <565fb1db-3618-4636-8820-1ca77dad07a2@web.de>
- References: <20250128-converge-secs-to-jiffies-part-two-v1-1-9a6ecf0b2308@linux.microsoft.com> <565fb1db-3618-4636-8820-1ca77dad07a2@web.de>
- User-agent: Mozilla Thunderbird
On 1/28/2025 1:02 PM, Markus Elfring wrote:
>> Teach the script to suggest conversions for timeout patterns where the
>> arguments to msecs_to_jiffies() are expressions as well.
>
> I propose to take another look at implementation details for such a script variant
> according to the semantic patch language.
>
>
> …
>> +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
>> @@ -11,12 +11,22 @@
>>
>> virtual patch
> …
>> -@depends on patch@ constant C; @@
>> +@depends on patch@
>> +expression E;
>> +@@
>>
>> -- msecs_to_jiffies(C * MSEC_PER_SEC)
>> -+ secs_to_jiffies(C)
>> +-msecs_to_jiffies
>> ++secs_to_jiffies
>> + (E
>> +- * \( 1000 \| MSEC_PER_SEC \)
>> + )
>
> 1. I do not see a need to keep an SmPL rule for the handling of constants
> (or literals) after the suggested extension for expressions.
Can you explain why? Would the expression rule also address the cases
where it's a constant or literal?
> 2. I find it nice that you indicate an attempt to make the shown SmPL code
> a bit more succinct.
> Unfortunately, further constraints should be taken better into account
> for the current handling of isomorphisms (and corresponding SmPL disjunctions).
> Thus I would find an SmPL rule (like the following) more appropriate.
>
Sorry, I couldn't follow your sentence construction or reasoning here. I
don't see how my patch is deficient, or different from your suggestion
below, especially given that it follows your feedback from part 1:
https://lore.kernel.org/all/9088f9a2-c4ab-4098-a255-25120df5c497@xxxxxx/
Can you point out specifically what SmPL isomorphisms or disjunctions
are broken with the patch in its current state?
Thanks,
Easwar
[Index of Archives]
[Linux Kernel]
[Linux ARM (vger)]
[Linux ARM MSM]
[Linux Omap]
[Linux Arm]
[Linux Tegra]
[Fedora ARM]
[Linux for Samsung SOC]
[eCos]
[Linux Fastboot]
[Gcc Help]
[Git]
[DCCP]
[IETF Announce]
[Security]
[Linux MIPS]
[Yosemite Campsites]
|