[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <565fb1db-3618-4636-8820-1ca77dad07a2@web.de>
Date: Tue, 28 Jan 2025 22:02:29 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Easwar Hariharan <eahariha@...ux.microsoft.com>, cocci@...ia.fr
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
linux-block@...r.kernel.org, linux-btrfs@...r.kernel.org,
linux-ide@...r.kernel.org, linux-nvme@...ts.infradead.org,
linux-pm@...r.kernel.org, linux-rdma@...r.kernel.org,
linux-scsi@...r.kernel.org, linux-sound@...r.kernel.org,
linux-spi@...r.kernel.org, linux-xfs@...r.kernel.org,
ceph-devel@...r.kernel.org, platform-driver-x86@...r.kernel.org,
dri-devel@...ts.freedesktop.org, ibm-acpi-devel@...ts.sourceforge.net,
imx@...ts.linux.dev, kernel@...gutronix.de,
linux-arm-kernel@...ts.infradead.org,
Andrew Morton <akpm@...ux-foundation.org>, Carlos Maiolino <cem@...nel.org>,
Chris Mason <clm@...com>, Christoph Hellwig <hch@....de>,
Damien Le Moal <dlemoal@...nel.org>, "Darrick J. Wong" <djwong@...nel.org>,
David Sterba <dsterba@...e.com>, Dick Kennedy <dick.kennedy@...adcom.com>,
Dongsheng Yang <dongsheng.yang@...ystack.cn>,
Fabio Estevam <festevam@...il.com>, Frank Li <Frank.Li@....com>,
Hans de Goede <hdegoede@...hat.com>,
Henrique de Moraes Holschuh <hmh@....eng.br>,
James Bottomley <James.Bottomley@...senPartnership.com>,
James Smart <james.smart@...adcom.com>, Jaroslav Kysela <perex@...ex.cz>,
Jason Gunthorpe <jgg@...pe.ca>, Jens Axboe <axboe@...nel.dk>,
Josef Bacik <josef@...icpanda.com>, Julia Lawall <Julia.Lawall@...ia.fr>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Ilya Dryomov <idryomov@...il.com>,
Kalesh Anakkur Purayil <kalesh-anakkur.purayil@...adcom.com>,
Keith Busch <kbusch@...nel.org>, Leon Romanovsky <leon@...nel.org>,
Mark Brown <broonie@...nel.org>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Nicolas Palix <nicolas.palix@...g.fr>, Niklas Cassel <cassel@...nel.org>,
Oded Gabbay <ogabbay@...nel.org>, Ricardo Ribalda <ribalda@...gle.com>,
Sagi Grimberg <sagi@...mberg.me>, Sascha Hauer <s.hauer@...gutronix.de>,
Sebastian Reichel <sre@...nel.org>,
Selvin Xavier <selvin.xavier@...adcom.com>, Shawn Guo <shawnguo@...nel.org>,
Shyam Sundar S K <Shyam-sundar.S-k@....com>, Takashi Iwai <tiwai@...e.com>,
Victor Gambier <victor.gambier@...ia.fr>, Xiubo Li <xiubli@...hat.com>,
Yaron Avizrat <yaron.avizrat@...el.com>
Subject: Re: [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch
expressions too
> 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
…
> -@...ends on patch@ constant C; @@
> +@...ends 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.
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.
@adjustment@
expression e;
@@
-msecs_to_jiffies
+secs_to_jiffies
(
(
-e * 1000
|
-e * MSEC_PER_SEC
)
+e
)
3. It seems that you would like to support only a single operation mode so far.
This system aspect can trigger further software development challenges.
Regards,
Markus
Powered by blists - more mailing lists