Re: [01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
- From: Markus Elfring <Markus.Elfring@xxxxxx>
- Date: Wed, 29 Jan 2025 10:40:18 +0100
- Cc: 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: <2402812d-b818-4d1b-9653-767c9cd89dda@linux.microsoft.com>
- References: <20250128-converge-secs-to-jiffies-part-two-v1-1-9a6ecf0b2308@linux.microsoft.com> <565fb1db-3618-4636-8820-1ca77dad07a2@web.de> <2402812d-b818-4d1b-9653-767c9cd89dda@linux.microsoft.com>
- Ui-outboundreport: notjunk:1;M01:P0:tcxCLGC+RCc=;ey0yBxZW/tRSJQW6qo2D+Q6kDrW B7ti/3QUhXC8WrcBjNzI4u6z+d1rV4adoqTUoUSMt/DqJcKI/DlrivOEoz806s/5+Kn56D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pz0osAScgdxIeUIW7Oo TT3dPmTAxqyMA5HLb2IdqDbNqBt78hG7Vp0fBYOvquK98imV2V34SSApTC+PTRD9nO5SEk1WD M5c0DPUlZtR3e/lmnDioWB77iUkT5JV0a7FRF40QmlHGvbSs8vfTQg9ZFgjUq8jYaGVb32YjP AEhromp4VpaoN9T5CJol8F+orrIemlZIcgjTh9W5NmdUN4pRCbHOUfJ/tbXwdPtCw5lPPfB1R 5kdsgtTCg2hWVnV9uMjqAZCd/Sr1UngGlxpd0=
- User-agent: Mozilla Thunderbird
>> …
>>> +++ 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?
Probably, yes.
>> 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/
I tend also to present possibilities for succinct SmPL code.
Unfortunately, software dependencies can trigger corresponding target conflicts.
> Can you point out specifically what SmPL isomorphisms or disjunctions
> are broken with the patch in its current state?
Please take another look at related information sources.
Would you like to achieve any benefits from commutativity (for multiplications)?
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/bd08cad3f802229dc629a13eefef2018c620e905/standard.iso#L241
https://github.com/coccinelle/coccinelle/blob/cca22217d1b4316224e80a18d0b08dd351234497/standard.iso#L241
Regards,
Markus
[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]
|