From: Xichao Zhao Date: Mon, 25 Aug 2025 09:09:04 +0000 (+0800) Subject: can: m_can: use us_to_ktime() where appropriate X-Git-Tag: v6.18-rc1~132^2~54^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=646cb48d447728f51957a96a70f919ee1b0fad07;p=thirdparty%2Flinux.git 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 Reviewed-by: Vincent Mailhol Link: https://patch.msgid.link/20250825090904.248927-1-zhao.xichao@vivo.com [mkl: remove not needed line break] Signed-off-by: Marc Kleine-Budde --- diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index fe74dbd2c9663..e1d725979685f 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; }