]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
can: m_can: use us_to_ktime() where appropriate
authorXichao Zhao <zhao.xichao@vivo.com>
Mon, 25 Aug 2025 09:09:04 +0000 (17:09 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sat, 13 Sep 2025 17:04:37 +0000 (19:04 +0200)
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>
drivers/net/can/m_can/m_can.c

index fe74dbd2c9663b7090678ab78318698d50ffb481..e1d725979685ff90bff9957bcf6193265bfbcb55 100644 (file)
@@ -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;
 }