Linux CAN drivers development
 help / color / mirror / Atom feed
* [PATCH] can: m_can: use us_to_ktime() where appropriate
@ 2025-08-25  9:09 Xichao Zhao
  2025-08-25 10:42 ` Vincent Mailhol
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Xichao Zhao @ 2025-08-25  9:09 UTC (permalink / raw)
  To: rcsekar, mkl, mailhol.vincent; +Cc: linux-can, linux-kernel, Xichao Zhao

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>
---
 drivers/net/can/m_can/m_can.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index fe74dbd2c966..32a57fbcce69 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -2214,10 +2214,10 @@ static int m_can_set_coalesce(struct net_device *dev,
 
 	if (cdev->rx_coalesce_usecs_irq)
 		cdev->irq_timer_wait =
-			ns_to_ktime(cdev->rx_coalesce_usecs_irq * NSEC_PER_USEC);
+			us_to_ktime(cdev->rx_coalesce_usecs_irq);
 	else
 		cdev->irq_timer_wait =
-			ns_to_ktime(cdev->tx_coalesce_usecs_irq * NSEC_PER_USEC);
+			us_to_ktime(cdev->tx_coalesce_usecs_irq);
 
 	return 0;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-08-27  7:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25  9:09 [PATCH] can: m_can: use us_to_ktime() where appropriate Xichao Zhao
2025-08-25 10:42 ` Vincent Mailhol
2025-08-25 17:01 ` Markus Elfring
2025-08-26  2:53   ` 赵西超
2025-08-26  8:41 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox