Skip to content

Commit 646cb48

Browse files
Xichao Zhaomarckleinebudde
authored andcommitted
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>
1 parent fc006f5 commit 646cb48

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/can/m_can/m_can.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,11 +2213,9 @@ static int m_can_set_coalesce(struct net_device *dev,
22132213
cdev->tx_coalesce_usecs_irq = ec->tx_coalesce_usecs_irq;
22142214

22152215
if (cdev->rx_coalesce_usecs_irq)
2216-
cdev->irq_timer_wait =
2217-
ns_to_ktime(cdev->rx_coalesce_usecs_irq * NSEC_PER_USEC);
2216+
cdev->irq_timer_wait = us_to_ktime(cdev->rx_coalesce_usecs_irq);
22182217
else
2219-
cdev->irq_timer_wait =
2220-
ns_to_ktime(cdev->tx_coalesce_usecs_irq * NSEC_PER_USEC);
2218+
cdev->irq_timer_wait = us_to_ktime(cdev->tx_coalesce_usecs_irq);
22212219

22222220
return 0;
22232221
}

0 commit comments

Comments
 (0)