[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5D732078.6080902@huawei.com>
Date: Sat, 7 Sep 2019 11:14:00 +0800
From: zhong jiang <zhongjiang@...wei.com>
To: Andrew Lunn <andrew@...n.ch>
CC: <davem@...emloft.net>, <kstewart@...uxfoundation.org>,
<gregkh@...uxfoundation.org>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ethernet: micrel: Use DIV_ROUND_CLOSEST directly to make
it readable
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
>
> .
>
Powered by blists - more mailing lists