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 F0BBCC43381 for ; Tue, 19 Feb 2019 08:01:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C988221904 for ; Tue, 19 Feb 2019 08:01:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727233AbfBSIBv (ORCPT ); Tue, 19 Feb 2019 03:01:51 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:14642 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725768AbfBSIBv (ORCPT ); Tue, 19 Feb 2019 03:01:51 -0500 X-IronPort-AV: E=Sophos;i="5.58,387,1544482800"; d="scan'208";a="369960184" Received: from abo-58-107-68.mrs.modulonet.fr (HELO hadrien) ([85.68.107.58]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Feb 2019 09:01:49 +0100 Date: Tue, 19 Feb 2019 09:01:49 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Mao Wenan cc: kernel-janitors@vger.kernel.org, netdev@vger.kernel.org, john.fastabend@gmail.com, hawk@kernel.org, jakub.kicinski@netronome.com, daniel@iogearbox.net, ast@kernel.org Subject: Re: [PATCH] net: ns83820: drop pointless static qualifier in ns83820_probe_phy() In-Reply-To: <20190219080659.89732-1-maowenan@huawei.com> Message-ID: References: <20190219080659.89732-1-maowenan@huawei.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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. > The old codes of first dereferencing this variable have > been commented out. So it is useless with 'static int first'. > /* > if (!first) { > ... > } > */ > first = 1; Do you need the variable at all? In the code, the commenting out is actually done with #if 0. It could be good for the commit log to reflect the code more accurately. Can the #if 0 and code be removed? Apparently it predates git. A commented out printk below also predates git. julia > > Signed-off-by: Mao Wenan > --- > drivers/net/ethernet/natsemi/ns83820.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c > index 958fced4dacf..fb064df3a1a6 100644 > --- a/drivers/net/ethernet/natsemi/ns83820.c > +++ b/drivers/net/ethernet/natsemi/ns83820.c > @@ -1869,7 +1869,7 @@ 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 > -- > 2.20.1 > >