mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 赵西超 <zhao.xichao@vivo.com>
To: Markus Elfring <Markus.Elfring@web.de>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Chandrasekar Ramakrishnan <rcsekar@samsung.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Subject: Re: [PATCH] can: m_can: use us_to_ktime() where appropriate
Date: Tue, 26 Aug 2025 02:53:56 +0000	[thread overview]
Message-ID: <0ab671c5-2855-4818-98b2-a52af4477e23@vivo.com> (raw)
In-Reply-To: <6ff39d21-5770-44da-9d1f-c4447b8baa3f@web.de>


> [You don't often get email from markus.elfring@web.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
>> The tx_coalesce_usecs_irq are more suitable for using the
>> us_to_ktime(). This can make the code more concise and
>> enhance readability.
> Wording suggestion:
>    The data structure members “rx_coalesce_usecs_irq” and
>    “tx_coalesce_usecs_irq” are more suitable for using us_to_ktime()
>    instead of calling ns_to_ktime().
>    Thus make the code more concise and enhance readability.
>
>
> Should the information “where appropriate” be replaced by the hint
> “in m_can_set_coalesce()” for the summary phrase?
>
>
> …
>> +++ 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);
> …
>
> How do you think about to apply the following source code variant instead?
>
>          cdev->irq_timer_wait = us_to_ktime(cdev->rx_coalesce_usecs_irq
>                                             ? cdev->rx_coalesce_usecs_irq
>                                             : cdev->tx_coalesce_usecs_irq);
>
>
> Regards,
> Markus

Thank you for your suggestions. I have incorporated them and sent the 
second version of the patch.


Regards,

Xichao Zhao


  reply	other threads:[~2025-08-26  2:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-25  9:09 Xichao Zhao
2025-08-25 10:42 ` Vincent Mailhol
2025-08-25 17:01 ` Markus Elfring
2025-08-26  2:53   ` 赵西超 [this message]
2025-08-26  8:41 ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ab671c5-2855-4818-98b2-a52af4477e23@vivo.com \
    --to=zhao.xichao@vivo.com \
    --cc=Markus.Elfring@web.de \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=mkl@pengutronix.de \
    --cc=rcsekar@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®