mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
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>
This commit is contained in:
parent
fc006f5478
commit
646cb48d44
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user