From 6cf828d2fbebd41d26f8233624bab88e5afc323b Mon Sep 17 00:00:00 2001 From: Easwar Hariharan Date: Tue, 25 Feb 2025 20:17:25 +0000 Subject: [PATCH] nvme: convert timeouts to secs_to_jiffies() 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 \) ) Link: https://lkml.kernel.org/r/20250225-converge-secs-to-jiffies-part-two-v3-11-a43967e36c88@linux.microsoft.com Signed-off-by: Easwar Hariharan Acked-by: Keith Busch Cc: Carlos Maiolino Cc: Carlos Maiolino Cc: Chris Mason Cc: Christoph Hellwig Cc: Damien Le Maol Cc: "Darrick J. Wong" Cc: David Sterba Cc: Dick Kennedy Cc: Dongsheng Yang Cc: Fabio Estevam Cc: Frank Li Cc: Hans de Goede Cc: Henrique de Moraes Holschuh Cc: Ilpo Jarvinen Cc: Ilya Dryomov Cc: James Bottomley Cc: James Smart Cc: Jaroslav Kysela Cc: Jason Gunthorpe Cc: Jens Axboe Cc: Josef Bacik Cc: Julia Lawall Cc: Kalesh Anakkur Purayil Cc: Leon Romanovsky Cc: Marc Kleine-Budde Cc: Mark Brown Cc: "Martin K. Petersen" Cc: Nicolas Palix Cc: Niklas Cassel Cc: Oded Gabbay Cc: Sagi Grimberg Cc: Sascha Hauer Cc: Sebastian Reichel Cc: Selvin Thyparampil Xavier Cc: Shawn Guo Cc: Shyam-sundar S-k Cc: Takashi Iwai Cc: Takashi Iwai Cc: Xiubo Li Signed-off-by: Andrew Morton --- drivers/nvme/host/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index f028913e2e62..24c3e1765d49 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4466,11 +4466,9 @@ static void nvme_fw_act_work(struct work_struct *work) nvme_auth_stop(ctrl); if (ctrl->mtfa) - fw_act_timeout = jiffies + - msecs_to_jiffies(ctrl->mtfa * 100); + fw_act_timeout = jiffies + msecs_to_jiffies(ctrl->mtfa * 100); else - fw_act_timeout = jiffies + - msecs_to_jiffies(admin_timeout * 1000); + fw_act_timeout = jiffies + secs_to_jiffies(admin_timeout); nvme_quiesce_io_queues(ctrl); while (nvme_ctrl_pp_status(ctrl)) { -- 2.50.1