From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 010CBC02195 for ; Wed, 29 Jan 2025 06:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=W7WsprbcBEfGK2k7Y3aFUT9StnbhuOuzj3SKN/VdRxY=; b=w4WSwl4tvAJSCcNT26ahSHGJHu bIfKwAvD4U60SjGRPjuu/RkMV2+D4KgfkauOVxAnF4gHXcp6J5rGNPuiE/VcAH6C9TB1z0D7aZOAx GZy6Th78XLVk9yKcNTrhpwXIi44qhgEXRXAFHBkUg7/q/m4kNabX//nxEVZGr/k9RIitYiX3mK3jf sAVxCjJ+pZw+MDa3VOmkpqOByw3zczN4B7N81wkxs/e8sSpGYbL2X+BTrhciRWs6MO0oIK/SH+J2c Q8A2G8h7V12npJfXKjb+MJiErLVywe3Am6p9hHQ1SNfpABMxZzg6nTiTFWX0WN45VtZvKQQnJ3LZV O5nMrdlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1td1VE-00000006Oya-0wtc; Wed, 29 Jan 2025 06:24:44 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcrJc-00000005iRD-3Gyt; Tue, 28 Jan 2025 19:32:06 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 3E73AA40CB9; Tue, 28 Jan 2025 19:30:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5F73C4CED3; Tue, 28 Jan 2025 19:32:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738092722; bh=owNZ34z8H8gKLRBDKBwfWe18qn3L1v88nfMIg3Pz1LA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SRwyMrI+7rEDcHW7IuHVGV+Beu/rz3fr4xRZE/2FNaxy/8w04xmtMB+5l/7OjtE7X g/ih+kr8TPIvY/SUMmDSRxJ9agHUzYETwZBr5Vr1MKa3PL3qv7X/YMDfOsOf9s2Vo5 w0pVGeJ25CkC8SD9eHiydelX+MwSAm4rpeoVmHUek+yQ4hSnEZyQONnAeLKb6DUyIW UK07D+tXIeIjeZTqlhU59S2JZeZJV301qEk91VI6n4APgSoo/WoePKctqgMT4vkHwk x3yl5NU9mWz8XPDeJzaWsXZh8d3H0HM6TZ2FVo8Y+2ItMnE82HdktnkogYjBpDnvic uPKV+NxOKmHOw== Date: Tue, 28 Jan 2025 11:32:02 -0800 From: "Darrick J. Wong" To: Easwar Hariharan Cc: 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 , 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 , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky , 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 Subject: Re: [PATCH 09/16] xfs: convert timeouts to secs_to_jiffies() Message-ID: <20250128193202.GR1611770@frogsfrogsfrogs> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> <20250128-converge-secs-to-jiffies-part-two-v1-9-9a6ecf0b2308@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-9-9a6ecf0b2308@linux.microsoft.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250128_113204_945170_86F392CE X-CRM114-Status: GOOD ( 18.29 ) X-Mailman-Approved-At: Tue, 28 Jan 2025 22:24:42 -0800 X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org On Tue, Jan 28, 2025 at 06:21:54PM +0000, Easwar Hariharan wrote: > Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced > secs_to_jiffies(). As the value here is a multiple of 1000, use > secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. > > This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with > the following Coccinelle rules: > > @depends on patch@ > expression E; > @@ > > -msecs_to_jiffies > +secs_to_jiffies > (E > - * \( 1000 \| MSEC_PER_SEC \) > ) > > Signed-off-by: Easwar Hariharan Looks good to me, Acked-by: "Darrick J. Wong" --D > --- > fs/xfs/xfs_icache.c | 2 +- > fs/xfs/xfs_sysfs.c | 7 +++---- > 2 files changed, 4 insertions(+), 5 deletions(-) > > diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c > index 7b6c026d01a1fc020a41a678964cdbf7a8113323..7a1feb8dc21f6f71d04f88de866e5a95925e0c54 100644 > --- a/fs/xfs/xfs_icache.c > +++ b/fs/xfs/xfs_icache.c > @@ -230,7 +230,7 @@ xfs_blockgc_queue( > rcu_read_lock(); > if (radix_tree_tagged(&pag->pag_ici_root, XFS_ICI_BLOCKGC_TAG)) > queue_delayed_work(mp->m_blockgc_wq, &pag->pag_blockgc_work, > - msecs_to_jiffies(xfs_blockgc_secs * 1000)); > + secs_to_jiffies(xfs_blockgc_secs)); > rcu_read_unlock(); > } > > diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c > index 60cb5318fdae3cc246236fd988b4749df57f8bfc..eed0f28afe97ead762a9539e45f292db7d0d0c4a 100644 > --- a/fs/xfs/xfs_sysfs.c > +++ b/fs/xfs/xfs_sysfs.c > @@ -568,8 +568,8 @@ retry_timeout_seconds_store( > if (val == -1) > cfg->retry_timeout = XFS_ERR_RETRY_FOREVER; > else { > - cfg->retry_timeout = msecs_to_jiffies(val * MSEC_PER_SEC); > - ASSERT(msecs_to_jiffies(val * MSEC_PER_SEC) < LONG_MAX); > + cfg->retry_timeout = secs_to_jiffies(val); > + ASSERT(secs_to_jiffies(val) < LONG_MAX); > } > return count; > } > @@ -686,8 +686,7 @@ xfs_error_sysfs_init_class( > if (init[i].retry_timeout == XFS_ERR_RETRY_FOREVER) > cfg->retry_timeout = XFS_ERR_RETRY_FOREVER; > else > - cfg->retry_timeout = msecs_to_jiffies( > - init[i].retry_timeout * MSEC_PER_SEC); > + cfg->retry_timeout = secs_to_jiffies(init[i].retry_timeout); > } > return 0; > > > -- > 2.43.0 > >