Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7CDE4C0218F for ; Sat, 1 Feb 2025 00:11:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E05C710E446; Sat, 1 Feb 2025 00:11:40 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="VAieKTRU"; dkim-atps=neutral Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by gabe.freedesktop.org (Postfix) with ESMTP id 853A010E446 for ; Sat, 1 Feb 2025 00:11:39 +0000 (UTC) Received: from [100.65.234.206] (unknown [20.236.11.185]) by linux.microsoft.com (Postfix) with ESMTPSA id 7E312210C329; Fri, 31 Jan 2025 16:11:36 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7E312210C329 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738368698; bh=URcW5d1wFUuTsZZ61zIwPjo02bqd3Xwwrj5siI/ejR4=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=VAieKTRUQduuqC4WMWksNFGAWFpl7wH2vcfIqWTtocImegfQz7yg09xx/uVhF84+8 X7djRP48uKGESU6HAg1NDd667oKEWQCkly+4NL3U6jOR2q4YvgMKiwE4cdu5TQF7bE 8JEcr4WkbAHOc5PABGxI8dv7PLkq6NUdzzexdebM= Message-ID: <632be2db-78d2-4249-92f0-3f60e0373172@linux.microsoft.com> Date: Fri, 31 Jan 2025 16:11:37 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: cocci@inria.fr, kernel-janitors@vger.kernel.org, eahariha@linux.microsoft.com, LKML , 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 , Ricardo Ribalda Subject: Re: [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too To: Markus Elfring References: <20250128-converge-secs-to-jiffies-part-two-v1-1-9a6ecf0b2308@linux.microsoft.com> From: Easwar Hariharan Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 1/30/2025 3:01 AM, Markus Elfring wrote: >> Teach the script to suggest conversions for timeout patterns where the >> arguments to msecs_to_jiffies() are expressions as well. > > Does anything hinder to benefit any more from a source code analysis approach > (like the following by the extended means of the semantic patch language)? > Thank you, this is much more useful feedback, specifically due to the suggested patch below. I did intend to learn about the other modes and progressively upgrade secs_to_jiffies.cocci with them in the future once the existing instances were resolved, to help with future code submissions. The patch below will be super helpful in that. As it stands, I'll fix up the current rules in v2 following your suggestion to keep the multiplication in each line to allow Coccinelle to use the commutativity properties and find more instances. I'll refrain from implementing the report mode until current instances have been fixed because of the issue we have already seen[1] with CI builds being broken. I would not want to break a strict CI build that is looking for coccicheck REPORT to return 0 results. [1]: https://lore.kernel.org/all/20250129-secs_to_jiffles-v1-1-35a5e16b9f03@chromium.org/ Thanks, Easwar (he/him)