Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3013707ybe; Sun, 8 Sep 2019 05:26:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEmu+Vfz0fIhIyIX/QJE/7YI3zOABdNwVIu2RIXZgL/y0E/67EHQQM4/GQ4RmGKuTZCrLJ X-Received: by 2002:aa7:87ca:: with SMTP id i10mr1143151pfo.58.1567945613917; Sun, 08 Sep 2019 05:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567945613; cv=none; d=google.com; s=arc-20160816; b=M4w911VYpOz9+W6R4lrFgHlz9No/ev6Kr3bmGb2HKmtT6NXVlOtdqEKxqzm4ID9LFJ 1NR25UGdx6xfVdpqsBY2og/FjAyrWFLBiRfhI3xV3gYfZdMkAow3eWaxWL8GW/I9sXf6 hQIpK+1Zx00BR3Kt4Gx8FoJZFr7/+6CpJCyAtLy81Qk9bJNy4UV1nx98qR8PEYgI42rc wapx1PXsCw8GSSLXuTLwLL3wR3I0BGLV7ltKGR41pB1lXU/2K0CqYQo0R5TRPyX9BNx6 iOFd4wPHcqhsYEa5ay4adKJDUYquQD6iiC/TXK3ACkMR0f488CnmrlLhQKZQjZqYdSm8 JbKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=mndWlYm2TctQXMNri/wCbOlRI+y89iA3OGkjE3ju+J0=; b=RSM1rmVSJ7FKBE0KgjmFxiWs2x+tT9+ztl+trddISj+Bf/V4nL2X2Yx3pn9B8p+28M PMH9J4Spipjgtrt+XzJIN7p95noKf9jeg+qD1w6kS6Yn7dcJVjJ4ct31qXo8hgmDL08n pdID4KUPCxIh2LnYNxWEJA57xgwd0f5kc1CzeU/O+YKV2r7sYOlIusBU8sHK3bqTUuyL x+7CA6gWGh0OHJJ/IGQTSj6aTIOxIjUipb+JHHwJp1FE8BuRci4am22vrgXjKLywMpuG 2wWPJqevJCg8ys+X7VH0KZJCj0dt9hw0RrtDST4x1HGTUugkSdz5tnUagnuV2rVP6gsO o0DA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 11si10499839pjf.8.2019.09.08.05.26.38; Sun, 08 Sep 2019 05:26:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393836AbfIGDOK (ORCPT + 99 others); Fri, 6 Sep 2019 23:14:10 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:44800 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726940AbfIGDOK (ORCPT ); Fri, 6 Sep 2019 23:14:10 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id F1938C2C61551D3F70D4; Sat, 7 Sep 2019 11:14:05 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Sat, 7 Sep 2019 11:14:01 +0800 Message-ID: <5D732078.6080902@huawei.com> Date: Sat, 7 Sep 2019 11:14:00 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Andrew Lunn CC: , , , , Subject: Re: [PATCH] ethernet: micrel: Use DIV_ROUND_CLOSEST directly to make it readable References: <1567698828-26825-1-git-send-email-zhongjiang@huawei.com> <20190906194050.GB2339@lunn.ch> In-Reply-To: <20190906194050.GB2339@lunn.ch> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > . >