linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Zhangshaokun <zhangshaokun@hisilicon.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH -next] net: dsa: mv88e6xxx: Fix build warning when CONFIG_NET_DSA_LEGACY is n
Date: Mon, 4 Mar 2019 15:57:10 +0100	[thread overview]
Message-ID: <20190304145710.GA17097@lunn.ch> (raw)
In-Reply-To: <bc528808-2ad5-90ae-4bc0-afa47a7c4f42@hisilicon.com>

On Mon, Mar 04, 2019 at 10:16:08PM +0800, Zhangshaokun wrote:
> Hi Andrew,
> 
> On 2019/3/4 21:26, Andrew Lunn wrote:
> > On Mon, Mar 04, 2019 at 08:43:01PM +0800, Shaokun Zhang wrote:
> >> When CONFIG_NET_DSA_LEGACY is n, there is a GCC bulid warning:
> >> drivers/net/dsa/mv88e6xxx/chip.c:4623:13: warning: ‘mv88e6xxx_ports_cmode_init’ defined but not used [-Wunused-function]
> >> static void mv88e6xxx_ports_cmode_init(struct mv88e6xxx_chip *chip)
> >> Let's fix it.
> > 
> > Hi Shaokun, Heiner
> > 
> > Although this fixes the warning, i suspect there i something wrong
> > with the original patch adding mv88e6390x_port_set_cmode(). It should
> > also be used without CONFIG_NET_DSA_LEGACY.
> 
> I checked the commit-id 2a93c1a3651f ("net: dsa: Allow compiling out legacy support") by Florian.
> Do you mean that CONFIG_NET_DSA_LEGACY shall be removed completely? :-)

No, i suspect mv88e6390x_ports_cmode_init() is being called from the
wrong place, or needs to be called from a second location.

[Goes and looks at the code]

Yes, it should also be called in mv88e6xxx_probe(). I would call it
just after the call to mv88e6xxx_detect(), so that it is the same as
in mv88e6xxx_drv_probe().

There are two ways DSA drivers can be probed. The legacy way, which is
optional, and is slowly getting removed, and the current way. Heiner
is new to DSA and probably missed that, and only handled the legacy
probe method. I also missed checking when i reviewed to patch :-(

   Andrew




  reply	other threads:[~2019-03-04 14:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-04 12:43 [PATCH -next] net: dsa: mv88e6xxx: Fix build warning when CONFIG_NET_DSA_LEGACY is n Shaokun Zhang
2019-03-04 13:26 ` Andrew Lunn
2019-03-04 14:16   ` Zhangshaokun
2019-03-04 14:57     ` Andrew Lunn [this message]
2019-03-04 18:18       ` Heiner Kallweit
2019-03-04 18:24         ` Florian Fainelli
2019-03-04 18:31           ` Heiner Kallweit
2019-03-04 18:36             ` Florian Fainelli
2019-03-05  0:57       ` Zhangshaokun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190304145710.GA17097@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.com \
    --cc=zhangshaokun@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).