Skip to content

Commit 1d2e01d

Browse files
easwarhbroonie
authored andcommitted
spi: spi-imx: convert timeouts to secs_to_jiffies()
Commit b35108a ("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 \) ) Acked-by: Mark Brown <[email protected]> Signed-off-by: Easwar Hariharan <[email protected]> Acked-by: Marc Kleine-Budde <[email protected]> Link: https://patch.msgid.link/20250225-converge-secs-to-jiffies-part-two-v3-13-a43967e36c88@linux.microsoft.com Acked-by: Damien Le Moal <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 32fcd1b commit 1d2e01d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-imx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ static int spi_imx_calculate_timeout(struct spi_imx_data *spi_imx, int size)
14491449
timeout += 1;
14501450

14511451
/* Double calculated timeout */
1452-
return msecs_to_jiffies(2 * timeout * MSEC_PER_SEC);
1452+
return secs_to_jiffies(2 * timeout);
14531453
}
14541454

14551455
static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx,

0 commit comments

Comments
 (0)