From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758016AbdLRDvK (ORCPT ); Sun, 17 Dec 2017 22:51:10 -0500 Received: from mx.socionext.com ([202.248.49.38]:30989 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757825AbdLRDvI (ORCPT ); Sun, 17 Dec 2017 22:51:08 -0500 Date: Mon, 18 Dec 2017 12:51:06 +0900 From: Kunihiko Hayashi To: David Miller Subject: Re: [PATCH net-next v6 2/2] net: ethernet: socionext: add AVE ethernet driver Cc: , , , , , , , , , , In-Reply-To: <20171215.125749.1752831437819486183.davem@davemloft.net> References: <1513245910-15961-3-git-send-email-hayashi.kunihiko@socionext.com> <20171215.125749.1752831437819486183.davem@davemloft.net> Message-Id: <20171218125105.962D.4A936039@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.70 [ja] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello David, On Fri, 15 Dec 2017 12:57:49 -0500 David Miller wrote: > From: Kunihiko Hayashi > Date: Thu, 14 Dec 2017 19:05:10 +0900 > > > +static void ave_desc_write(struct net_device *ndev, enum desc_id id, > > + int entry, int offset, u32 val) > > +{ > > + struct ave_private *priv = netdev_priv(ndev); > > + u32 addr = (id == AVE_DESCID_TX) ? priv->tx.daddr : priv->rx.daddr; > > Please always order local variables from longest to shortest line. > > Audit your entire submission for this issue, thank you. I see. I'll fix the order of local variables. > > + ret = register_netdev(ndev); > > + if (ret) { > > + dev_err(dev, "failed to register netdevice\n"); > > + goto out_del_napi; > > + } > > + > > + platform_set_drvdata(pdev, ndev); > > You must make all software state settings before reigster_netdev() is > invoked. > > At the exact moment you call register_netdev(), your device can be > brought up, interrupts processed, PHY state changes made, etc. > > So you must put this platform_set_drvdata() before the > register_netdev() call. > > Generally speaking, register_netdev() must always be the last state > modification done by your probe routine. Indeed. It's not good to invoke register_netdev() with all software initialization not completed. I'll move register_netdev() after all initialization. Thank you, --- Best Regards, Kunihiko Hayashi