Re: [PATCH v2] can: m_can: use us_to_ktime() in m_can_set_coalesce()

From: Markus Elfring
Date: Tue Aug 26 2025 - 01:44:46 EST


> Replace the if-else statement with a ternary operator to
> set cdev->irq_timer_wait. Use us_to_ktime() instead of
> ns_to_ktime() with NSEC_PER_USEC multiplication. Simplify


You should occasionally use more than 57 characters in text lines
of such a change description.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.17-rc3#n638


Will an enumeration become helpful here?


…> +++ b/drivers/net/can/m_can/m_can.c
> @@ -2211,13 +2211,9 @@ static int m_can_set_coalesce(struct net_device *dev,
…> + cdev->irq_timer_wait = us_to_ktime(cdev->rx_coalesce_usecs_irq ?
> + cdev->rx_coalesce_usecs_irq :
> + cdev->tx_coalesce_usecs_irq);


I am curious how coding style preferences will evolve further also for
the usage of the conditional operator at such a place.

Regards,
Markus