Skip to content

Commit

Permalink
spi: spi-fsl-lpspi: convert timeouts to secs_to_jiffies()
Browse files Browse the repository at this point in the history
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 <broonie@kernel.org>
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Link: https://patch.msgid.link/20250225-converge-secs-to-jiffies-part-two-v3-12-a43967e36c88@linux.microsoft.com
Acked-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Easwar Hariharan authored and Mark Brown committed Feb 26, 2025
1 parent f3bfa0f commit 32fcd1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-fsl-lpspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ static int fsl_lpspi_calculate_timeout(struct fsl_lpspi_data *fsl_lpspi,
timeout += 1;

/* Double calculated timeout */
return msecs_to_jiffies(2 * timeout * MSEC_PER_SEC);
return secs_to_jiffies(2 * timeout);
}

static int fsl_lpspi_dma_transfer(struct spi_controller *controller,
Expand Down

0 comments on commit 32fcd1b

Please sign in to comment.