public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Easwar Hariharan <eahariha@linux.microsoft.com>, cocci@inria.fr
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org, linux-block@vger.kernel.org,
	linux-btrfs@vger.kernel.org, linux-ide@vger.kernel.org,
	linux-nvme@lists.infradead.org, linux-pm@vger.kernel.org,
	linux-rdma@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-sound@vger.kernel.org, linux-spi@vger.kernel.org,
	linux-xfs@vger.kernel.org, ceph-devel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	ibm-acpi-devel@lists.sourceforge.net, imx@lists.linux.dev,
	kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Carlos Maiolino" <cem@kernel.org>, "Chris Mason" <clm@fb.com>,
	"Christoph Hellwig" <hch@lst.de>,
	"Damien Le Moal" <dlemoal@kernel.org>,
	"Darrick J. Wong" <djwong@kernel.org>,
	"David Sterba" <dsterba@suse.com>,
	"Dick Kennedy" <dick.kennedy@broadcom.com>,
	"Dongsheng Yang" <dongsheng.yang@easystack.cn>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Frank Li" <Frank.Li@nxp.com>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Henrique de Moraes Holschuh" <hmh@hmh.eng.br>,
	"James Bottomley" <James.Bottomley@HansenPartnership.com>,
	"James Smart" <james.smart@broadcom.com>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Jason Gunthorpe" <jgg@ziepe.ca>, "Jens Axboe" <axboe@kernel.dk>,
	"Josef Bacik" <josef@toxicpanda.com>,
	"Julia Lawall" <Julia.Lawall@inria.fr>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Ilya Dryomov" <idryomov@gmail.com>,
	"Kalesh Anakkur Purayil" <kalesh-anakkur.purayil@broadcom.com>,
	"Keith Busch" <kbusch@kernel.org>,
	"Leon Romanovsky" <leon@kernel.org>,
	"Mark Brown" <broonie@kernel.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"Nicolas Palix" <nicolas.palix@imag.fr>,
	"Niklas Cassel" <cassel@kernel.org>,
	"Oded Gabbay" <ogabbay@kernel.org>,
	"Ricardo Ribalda" <ribalda@google.com>,
	"Sagi Grimberg" <sagi@grimberg.me>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Selvin Xavier" <selvin.xavier@broadcom.com>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Victor Gambier" <victor.gambier@inria.fr>,
	"Xiubo Li" <xiubli@redhat.com>,
	"Yaron Avizrat" <yaron.avizrat@intel.com>
Subject: Re: [01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
Date: Wed, 29 Jan 2025 10:40:18 +0100	[thread overview]
Message-ID: <9ca0337d-e378-4de5-99be-1dfa1d4f8cff@web.de> (raw)
In-Reply-To: <2402812d-b818-4d1b-9653-767c9cd89dda@linux.microsoft.com>

>> …
>>> +++ 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@web.de/

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


  reply	other threads:[~2025-01-29  9:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250128-converge-secs-to-jiffies-part-two-v1-1-9a6ecf0b2308@linux.microsoft.com>
2025-01-28 21:02 ` [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too Markus Elfring
2025-01-29  5:05   ` Easwar Hariharan
2025-01-29  9:40     ` Markus Elfring [this message]
2025-02-03  7:24       ` [01/16] " Markus Elfring
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

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=9ca0337d-e378-4de5-99be-1dfa1d4f8cff@web.de \
    --to=markus.elfring@web.de \
    --cc=Frank.Li@nxp.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=Julia.Lawall@inria.fr \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=broonie@kernel.org \
    --cc=cassel@kernel.org \
    --cc=cem@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=clm@fb.com \
    --cc=cocci@inria.fr \
    --cc=dick.kennedy@broadcom.com \
    --cc=djwong@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=dongsheng.yang@easystack.cn \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=dsterba@suse.com \
    --cc=eahariha@linux.microsoft.com \
    --cc=festevam@gmail.com \
    --cc=hch@lst.de \
    --cc=hdegoede@redhat.com \
    --cc=hmh@hmh.eng.br \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=idryomov@gmail.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=imx@lists.linux.dev \
    --cc=james.smart@broadcom.com \
    --cc=jgg@ziepe.ca \
    --cc=josef@toxicpanda.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=kbusch@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=leon@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nicolas.palix@imag.fr \
    --cc=ogabbay@kernel.org \
    --cc=perex@perex.cz \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=ribalda@google.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sagi@grimberg.me \
    --cc=selvin.xavier@broadcom.com \
    --cc=shawnguo@kernel.org \
    --cc=sre@kernel.org \
    --cc=tiwai@suse.com \
    --cc=victor.gambier@inria.fr \
    --cc=xiubli@redhat.com \
    --cc=yaron.avizrat@intel.com \
    /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