From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout.web.de (mout.web.de [212.227.17.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F7A81917F9; Wed, 29 Jan 2025 09:40:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738143644; cv=none; b=Td7qm/3cZgwYjyMxLmZLmUO1zmIEGtxTN4ff9gVizbxnP/0VVz1ZyhefltpY+h5rdA2OQnhyHCVuUl2lFmxOqai7fe0Lc5GyF3cGrt6hifGySFdT5mnubViTT2WW++nEoaJEDCLUs/rVx8D8gJnfclVfVRPgP9oRitqyJsDb1Tw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738143644; c=relaxed/simple; bh=f6YZi+aj3vtvGBm2x62fa1lw4+jY/LfPDrFJLCES+DY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qoMJCS+7sm0r3KwmP6/B8SishjWvXuQrJTfabMFowKWvxai/SNKa9e0kI69UqTAgPCetmcB55cd85FIz0UA5fNHXLv9e7Msr17x3wMvZgEgExTxVRmcOqqaDvJQzDcFX/iuoHckWXV+rry4BpimOE2B0Zsg3J7ZTJNbHIY7yMUc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=ibsOXJKP; arc=none smtp.client-ip=212.227.17.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="ibsOXJKP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1738143622; x=1738748422; i=markus.elfring@web.de; bh=RmUlpFblDQ0X0FrPNxA6WyeicYW3HpJ3EyGlM0jP5z0=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=ibsOXJKPJKhZo8FqJFepmaYQoSFoyR2qxzl8lohWNNUQx+2NF2ManFbNjUNGq/F2 gbw8iml79L7rvtKd56Ir7+yYHXrAe1EUIefoTtrBNrmtFI2yM2WYsLj1b568yC1rb SKGUWYn0X41jPRogXjuGLSd6Gt6171dGmUJ2Fp3bc0pBO92HArHd48fDFFdCCxzPK pf78m0ogusJQNS3QQ3zn1K/mM4iA6yn4B0KggTtABnb9cI7MMqnv247Vl4f+VntcE +DVoabadzyBcjKoDGRsAmxtyEkjkG+dxMfHbTqq28F/8W87L00uXvdFhKdqm9Gctj xUEgsrypLeLKtXHbAg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.29] ([94.31.93.19]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MG994-1tgKE62NvY-00Fdf6; Wed, 29 Jan 2025 10:40:22 +0100 Message-ID: <9ca0337d-e378-4de5-99be-1dfa1d4f8cff@web.de> Date: Wed, 29 Jan 2025 10:40:18 +0100 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too To: Easwar Hariharan , cocci@inria.fr Cc: LKML , 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 , Carlos Maiolino , Chris Mason , Christoph Hellwig , Damien Le Moal , "Darrick J. Wong" , David Sterba , Dick Kennedy , Dongsheng Yang , Fabio Estevam , Frank Li , Hans de Goede , Henrique de Moraes Holschuh , James Bottomley , James Smart , Jaroslav Kysela , Jason Gunthorpe , Jens Axboe , Josef Bacik , Julia Lawall , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Ilya Dryomov , Kalesh Anakkur Purayil , Keith Busch , Leon Romanovsky , Mark Brown , "Martin K. Petersen" , Nicolas Palix , Niklas Cassel , Oded Gabbay , Ricardo Ribalda , Sagi Grimberg , Sascha Hauer , Sebastian Reichel , Selvin Xavier , Shawn Guo , Shyam Sundar S K , Takashi Iwai , Victor Gambier , Xiubo Li , Yaron Avizrat 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> Content-Language: en-GB From: Markus Elfring In-Reply-To: <2402812d-b818-4d1b-9653-767c9cd89dda@linux.microsoft.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:VVUayMb32w7y67C7tTjgB5AAr0xhckczX0N8TokrIpC9jN6eUE9 EFsN7wRaBX0tQgtAxOLriEuyy3B/8avbPqaD1zz3GlxmzANwcYY0B13b3+dGcse9e29fR2B x1FDILYMT0Hm6Op4dZPmgiuO2ynGivSf8q+hlfpEEa8MIXRg6GY1vfP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aIlaVUahCedhQsFB49sgDWhVH58n5+/Z9aWfVKo9SGwG1/1EYyVhs xdj7mKATCRxJL8YFYbK1K5zFB2c5chXeAOrRuI6GfbxLg4Jr5TwIV+gUIoOLkM9oBMdE3PZmY FmuKpySVCwL9uRLQ0lYfPXIDXqcQix+7IQpKOnC7/mKJSccV7o1cXqpz0osAScgdxIeUIW7Oo TT3dPmTAxqyMA5HLb2IdqDbNqBt78hG7Vp0fBYOvquK98imV2V34SSApTC+PTRD9nO5SEk1WD M5c0DPUlZtR3e/lmnDioWB77iUkT5JV0a7FRF40QmlHGvbSs8vfTQg9ZFgjUq8jYaGVb32YjP AEhromp4VpaoN9T5CJol8F+orrIemlZIcgjTh9W5NmdUN4pRCbHOUfJ/tbXwdPtCw5lPPfB1R 5kdsgtTCg2hWVnV9uMjqAZCd/Sr1UngGlxpd0= >> =E2=80=A6 >>> +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci >>> @@ -11,12 +11,22 @@ >>> >>> virtual patch >> =E2=80=A6 >>> -@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 constan= ts >> (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 c= ode >> a bit more succinct. >> Unfortunately, further constraints should be taken better into accou= nt >> for the current handling of isomorphisms (and corresponding SmPL dis= junctions). >> 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 conf= licts. > 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 multiplicat= ions)? https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/bd08cad3f802229dc629a= 13eefef2018c620e905/standard.iso#L241 https://github.com/coccinelle/coccinelle/blob/cca22217d1b4316224e80a18d0b0= 8dd351234497/standard.iso#L241 Regards, Markus