From patchwork Tue Feb 25 20:17:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 868381 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 721E920FA9E; Tue, 25 Feb 2025 20:17:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740514642; cv=none; b=HfN5ACIIQ4aTXMkuXPurzGkWaRdF6ZKet0Vuu0XmfEacWndGdqZBFwaCIhhqOY10MXEj9cTHxi4e9FF4fDcfcdduWlw421LG+Nr+bFW8HjIPVYIu7yJLFx6eqijsLY1NcFCoE2STLPaiJn0kay1V6OzPg07LSNHf9Fu0TnvGchg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740514642; c=relaxed/simple; bh=KhNEyo7WFu+pfBKWpwr7dBCkfYqG9oS0AfyoC6gzP2I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b3CDrWiJDIGshR/XpN3pqHS/BsSmvt33nMebk7jMiVa7MQsOzCdU5JwlkeKMsjXF2SgBjJX0S0IFvZttUS1Cg/Ay15em5GbA0wrNRkGzARh34kc8iImSxqoVBwVqB32R2EEn990KaRwXWQ9mjwVAh4sGwKKX8chWalSsBUqtNPs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=OP63wp67; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="OP63wp67" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id BF51B203CDFD; Tue, 25 Feb 2025 12:17:19 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BF51B203CDFD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1740514639; bh=iYMbK5A793RDdkoEPga+PoRyWET+ntXiAELhCjFiDKo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=OP63wp67iKSqHjNTjMNd+sihLCyoASTZi2GNLl0ELqRwvrBXcEngcH+yXafC8Yprq nAvYY5Wrea0EY1UvsDuANN22sm/ZDZFvEyjRA+KLA6UssBgo0/5UVPQNqQpxTLUDBc wEQUX4uMwl08WGSAzFvomPPI3q3DYIQICkks+WHI= From: Easwar Hariharan Date: Tue, 25 Feb 2025 20:17:15 +0000 Subject: [PATCH v3 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250225-converge-secs-to-jiffies-part-two-v3-1-a43967e36c88@linux.microsoft.com> References: <20250225-converge-secs-to-jiffies-part-two-v3-0-a43967e36c88@linux.microsoft.com> In-Reply-To: <20250225-converge-secs-to-jiffies-part-two-v3-0-a43967e36c88@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Teach the script to suggest conversions for timeout patterns where the arguments to msecs_to_jiffies() are expressions as well. Signed-off-by: Easwar Hariharan --- scripts/coccinelle/misc/secs_to_jiffies.cocci | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/coccinelle/misc/secs_to_jiffies.cocci b/scripts/coccinelle/misc/secs_to_jiffies.cocci index 8bbb2884ea5db939c63fd4513cf5ca8c977aa8cb..416f348174ca659b544441f5f68f04a41d1ad4a3 100644 --- a/scripts/coccinelle/misc/secs_to_jiffies.cocci +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci @@ -20,3 +20,13 @@ virtual patch - msecs_to_jiffies(C * MSEC_PER_SEC) + secs_to_jiffies(C) + +@depends on patch@ expression E; @@ + +- msecs_to_jiffies(E * 1000) ++ secs_to_jiffies(E) + +@depends on patch@ expression E; @@ + +- msecs_to_jiffies(E * MSEC_PER_SEC) ++ secs_to_jiffies(E)