From: zhong jiang <zhongjiang@huawei.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: <davem@davemloft.net>, <kstewart@linuxfoundation.org>,
<gregkh@linuxfoundation.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ethernet: micrel: Use DIV_ROUND_CLOSEST directly to make it readable
Date: Sat, 7 Sep 2019 11:14:00 +0800 [thread overview]
Message-ID: <5D732078.6080902@huawei.com> (raw)
In-Reply-To: <20190906194050.GB2339@lunn.ch>
On 2019/9/7 3:40, Andrew Lunn wrote:
> On Thu, Sep 05, 2019 at 11:53:48PM +0800, zhong jiang wrote:
>> The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d
>> but is perhaps more readable.
> Hi Zhong
>
> Did you find this by hand, or did you use a tool. If a tool is used,
> it is normal to give some credit to the tool.
With the following help of Coccinelle.
-(((x) + ((__divisor) / 2)) / (__divisor))
+ DIV_ROUND_CLOSEST(x,__divisor)
Sometimes, I will add the information in the description. Sometimes, I desn't do that.
I will certainly add the description when I send an series of patches to modify the case.
Thanks,
zhong jiang
> Thanks
> Andrew
>
> .
>
next prev parent reply other threads:[~2019-09-07 3:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-05 15:53 [PATCH] ethernet: micrel: Use DIV_ROUND_CLOSEST directly to make it readable zhong jiang
2019-09-06 19:40 ` Andrew Lunn
2019-09-07 3:14 ` zhong jiang [this message]
2019-09-07 15:58 ` Andrew Lunn
2019-09-07 15:17 ` David Miller
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=5D732078.6080902@huawei.com \
--to=zhongjiang@huawei.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=kstewart@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.