From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B4F5C43381 for ; Tue, 19 Feb 2019 08:39:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1CEA21904 for ; Tue, 19 Feb 2019 08:39:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727298AbfBSIjV (ORCPT ); Tue, 19 Feb 2019 03:39:21 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:3681 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725765AbfBSIjV (ORCPT ); Tue, 19 Feb 2019 03:39:21 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id AECE04DCAA6D30FFA253; Tue, 19 Feb 2019 16:39:18 +0800 (CST) Received: from [127.0.0.1] (10.177.96.96) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.408.0; Tue, 19 Feb 2019 16:39:13 +0800 Subject: Re: [PATCH v2] net: ns83820: drop pointless static qualifier in ns83820_probe_phy() To: Julia Lawall References: <20190219084214.96202-1-maowenan@huawei.com> CC: , , , , , , From: maowenan Message-ID: <2dbcd9ef-2cf2-e3c7-edb5-67f0cfb00f13@huawei.com> Date: Tue, 19 Feb 2019 16:39:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.96.96] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2019/2/19 16:31, Julia Lawall wrote: > > > On Tue, 19 Feb 2019, Mao Wenan wrote: > >> There is no need to have the 'int first' static >> since new value always be assigned before use it. >> >> This patch cleans up the codes in ns83820_probe_phy() as well. > > As mentioned previously, there is no use of first in the function at all, > other than setting it to 1. So it can be just dropped completely. > OK, thank you for your comments. > "codes" is also a word that I am particularly not fond of. Just "code" is > fine. > > "cleans up" is not very specific about what is going on, and why. > > julia > >> >> Signed-off-by: Mao Wenan >> --- >> v1->v2: delete unused codes. >> drivers/net/ethernet/natsemi/ns83820.c | 17 +---------------- >> 1 file changed, 1 insertion(+), 16 deletions(-) >> >> diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c >> index 958fced4dacf..37694f6843fe 100644 >> --- a/drivers/net/ethernet/natsemi/ns83820.c >> +++ b/drivers/net/ethernet/natsemi/ns83820.c >> @@ -1869,23 +1869,11 @@ static unsigned ns83820_mii_write_reg(struct ns83820 *dev, unsigned phy, unsigne >> static void ns83820_probe_phy(struct net_device *ndev) >> { >> struct ns83820 *dev = PRIV(ndev); >> - static int first; >> + int first; >> int i; >> #define MII_PHYIDR1 0x02 >> #define MII_PHYIDR2 0x03 >> >> -#if 0 >> - if (!first) { >> - unsigned tmp; >> - ns83820_mii_read_reg(dev, 1, 0x09); >> - ns83820_mii_write_reg(dev, 1, 0x10, 0x0d3e); >> - >> - tmp = ns83820_mii_read_reg(dev, 1, 0x00); >> - ns83820_mii_write_reg(dev, 1, 0x00, tmp | 0x8000); >> - udelay(1300); >> - ns83820_mii_read_reg(dev, 1, 0x09); >> - } >> -#endif >> first = 1; >> >> for (i=1; i<2; i++) { >> @@ -1894,9 +1882,6 @@ static void ns83820_probe_phy(struct net_device *ndev) >> a = ns83820_mii_read_reg(dev, i, MII_PHYIDR1); >> b = ns83820_mii_read_reg(dev, i, MII_PHYIDR2); >> >> - //printk("%s: phy %d: 0x%04x 0x%04x\n", >> - // ndev->name, i, a, b); >> - >> for (j=0; j<0x16; j+=4) { >> dprintk("%s: [0x%02x] %04x %04x %04x %04x\n", >> ndev->name, j, >> -- >> 2.20.1 >> >> > > . >