From: Markus Elfring <Markus.Elfring@web.de>
To: cocci@inria.fr, Julia Lawall <Julia.Lawall@inria.fr>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Easwar Hariharan <eahariha@linux.microsoft.com>,
Nicolas Palix <nicolas.palix@imag.fr>,
Ricardo Ribalda <ribalda@chromium.org>,
Victor Gambier <victor.gambier@inria.fr>
Subject: Re: [01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
Date: Mon, 3 Feb 2025 08:24:19 +0100 [thread overview]
Message-ID: <80cae791-663c-4589-b67e-d4d1049fcd98@web.de> (raw)
In-Reply-To: <9ca0337d-e378-4de5-99be-1dfa1d4f8cff@web.de>
> I tend also to present possibilities for succinct SmPL code.
> Unfortunately, software dependencies can trigger corresponding target conflicts.
@adjustment@
expression e;
@@
-msecs_to_jiffies
+secs_to_jiffies
(
(
-e * 1000
|
-e * MSEC_PER_SEC
)
+e
)
A command (like the following) can indicate how isomorphisms are applied
for the transformation of some data into SmPL disjunctions.
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/bd08cad3f802229dc629a13eefef2018c620e905/standard.iso#L252-257
Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> spatch --parse-cocci suggestion3_for_Easwar_Hariharan-20250128.cocci
…
@adjustment@
expression e;
@@
(
-msecs_to_jiffies
>>> secs_to_jiffies
(-e -* -1000
<<< e
)
|
-msecs_to_jiffies
>>> secs_to_jiffies
(-1000 -* -e
<<< e
)
|
-msecs_to_jiffies
>>> secs_to_jiffies
(-e -* -MSEC_PER_SEC
<<< e
)
|
-msecs_to_jiffies
>>> secs_to_jiffies
(-MSEC_PER_SEC -* -e
<<< e
)
)
Grep query
msecs_to_jiffies
I find parts of such a data representation improvable.
I would usually expect here that parentheses for the selection of call parameters
will not appear in the first text column
(so that confusion will be avoided for the usage of delimiters according to SmPL disjunctions).
The isomorphism specifications represent also a software development status.
It seems that they do not contain direct support for SmPL disjunctions so far
(as an explicit entity).
The identifier “HZ” is used by the referenced macro.
https://elixir.bootlin.com/linux/v6.13/source/include/linux/jiffies.h#L530-L540
https://lore.kernel.org/linux-kernel/173831299312.31546.8797889985487965830.tip-bot2@tip-bot2/
Is there a need to take further (preprocessor symbol) variations better into account?
How do you think about the handling of multiplication factors within bigger expressions
(and not only at the beginning or end of a term)?
Would you be looking for further restrictions on expression combinations?
Regards,
Markus
next prev parent reply other threads:[~2025-02-03 7:24 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
2025-01-28 18:21 ` [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too Easwar Hariharan
2025-01-28 21:02 ` Markus Elfring
2025-01-29 5:05 ` Easwar Hariharan
2025-01-29 9:40 ` [01/16] " Markus Elfring
2025-02-03 7:24 ` Markus Elfring [this message]
2025-01-30 11:01 ` [PATCH 01/16] " Markus Elfring
2025-02-01 0:11 ` Easwar Hariharan
2025-02-03 7:22 ` [01/16] " Markus Elfring
2025-01-28 18:21 ` [PATCH 02/16] scsi: lpfc: convert timeouts to secs_to_jiffies() Easwar Hariharan
2025-01-28 18:21 ` [PATCH 03/16] accel/habanalabs: " Easwar Hariharan
2025-01-28 18:21 ` [PATCH 04/16] ALSA: ac97: " Easwar Hariharan
2025-01-29 9:46 ` Takashi Iwai
2025-01-28 18:21 ` [PATCH 05/16] btrfs: " Easwar Hariharan
2025-01-28 19:28 ` David Sterba
2025-01-28 18:21 ` [PATCH 06/16] rbd: " Easwar Hariharan
2025-01-29 21:03 ` Easwar Hariharan
2025-02-03 21:19 ` Ilya Dryomov
2025-01-28 18:21 ` [PATCH 07/16] libceph: " Easwar Hariharan
2025-01-28 18:21 ` [PATCH 08/16] libata: zpodd: " Easwar Hariharan
2025-01-29 0:21 ` Damien Le Moal
2025-01-29 17:36 ` Easwar Hariharan
2025-01-28 18:21 ` [PATCH 09/16] xfs: " Easwar Hariharan
2025-01-28 19:32 ` Darrick J. Wong
2025-01-29 5:21 ` Christoph Hellwig
2025-01-29 17:12 ` Easwar Hariharan
2025-01-29 18:14 ` Easwar Hariharan
2025-01-29 6:27 ` Carlos Maiolino
2025-01-28 18:21 ` [PATCH 10/16] power: supply: da9030: " Easwar Hariharan
2025-01-28 18:21 ` [PATCH 11/16] nvme: " Easwar Hariharan
2025-01-28 18:28 ` Keith Busch
2025-01-28 18:21 ` [PATCH 12/16] spi: spi-fsl-lpspi: " Easwar Hariharan
2025-01-29 11:28 ` Mark Brown
2025-01-28 18:21 ` [PATCH 13/16] spi: spi-imx: " Easwar Hariharan
2025-01-29 11:30 ` Mark Brown
2025-01-28 18:21 ` [PATCH 14/16] platform/x86/amd/pmf: " Easwar Hariharan
2025-01-29 13:12 ` Ilpo Järvinen
2025-01-29 17:12 ` Easwar Hariharan
2025-01-28 18:22 ` [PATCH 15/16] platform/x86: thinkpad_acpi: " Easwar Hariharan
2025-01-28 18:22 ` [PATCH 16/16] RDMA/bnxt_re: " Easwar Hariharan
2025-01-29 0:16 ` [PATCH 00/16] Converge on using secs_to_jiffies() part two Andrew Morton
2025-02-13 17:45 ` Easwar Hariharan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=80cae791-663c-4589-b67e-d4d1049fcd98@web.de \
--to=markus.elfring@web.de \
--cc=Julia.Lawall@inria.fr \
--cc=akpm@linux-foundation.org \
--cc=cocci@inria.fr \
--cc=eahariha@linux.microsoft.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.palix@imag.fr \
--cc=ribalda@chromium.org \
--cc=victor.gambier@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome