diff options
author | Xichao Zhao <zhao.xichao@vivo.com> | 2025-08-25 17:09:04 +0800 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2025-09-13 19:04:37 +0200 |
commit | 646cb48d447728f51957a96a70f919ee1b0fad07 (patch) | |
tree | c1f13494ecb0aad4a07a470492a2e4c5505b35e6 | |
parent | fc006f5478fcf07d79b35e9dcdc51ecd11a6bf82 (diff) |
can: m_can: use us_to_ktime() where appropriate
The tx_coalesce_usecs_irq are more suitable for using the
us_to_ktime(). This can make the code more concise and
enhance readability.
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
Reviewed-by: Vincent Mailhol <mailhol@kernel.org>
Link: https://patch.msgid.link/20250825090904.248927-1-zhao.xichao@vivo.com
[mkl: remove not needed line break]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r-- | drivers/net/can/m_can/m_can.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index fe74dbd2c966..e1d725979685 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -2213,11 +2213,9 @@ static int m_can_set_coalesce(struct net_device *dev, cdev->tx_coalesce_usecs_irq = ec->tx_coalesce_usecs_irq; if (cdev->rx_coalesce_usecs_irq) - cdev->irq_timer_wait = - ns_to_ktime(cdev->rx_coalesce_usecs_irq * NSEC_PER_USEC); + cdev->irq_timer_wait = us_to_ktime(cdev->rx_coalesce_usecs_irq); else - cdev->irq_timer_wait = - ns_to_ktime(cdev->tx_coalesce_usecs_irq * NSEC_PER_USEC); + cdev->irq_timer_wait = us_to_ktime(cdev->tx_coalesce_usecs_irq); return 0; } |