From: Florian Fainelli <f.fainelli@gmail.com>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com,
"David S. Miller" <davem@davemloft.net>,
Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH net-next 4/5] net: dsa: add slave get master helper
Date: Thu, 12 Oct 2017 16:02:08 -0700 [thread overview]
Message-ID: <e3e7001e-8618-0b31-cd28-ebcdad561f7b@gmail.com> (raw)
In-Reply-To: <20171012225156.20758-5-vivien.didelot@savoirfairelinux.com>
On 10/12/2017 03:51 PM, Vivien Didelot wrote:
> Many part of the DSA slave code require to get the master device
> assigned to a slave device. Remove dsa_master_netdev() in favor of a
> dsa_slave_get_master() helper which does that.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---
> +static inline struct net_device *
> +dsa_slave_get_master(const struct net_device *dev)
> +{
> + struct dsa_port *dp = dsa_slave_to_port(dev);
> +
> + return dp->cpu_dp->netdev;
> +}
Nit: _get may convey the idea that a reference count may be incremented
when the function is called (balanced with a _put), so maybe name it
dsa_slave_to_master() which is more in line with dsa_slave_to_port() as
well? Other than that:
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
next prev parent reply other threads:[~2017-10-12 23:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-12 22:51 [PATCH net-next 0/5] net: dsa: master and slave helpers Vivien Didelot
2017-10-12 22:51 ` [PATCH net-next 1/5] net: dsa: use port's cpu_dp when creating a slave Vivien Didelot
2017-10-12 22:53 ` Florian Fainelli
2017-10-12 22:51 ` [PATCH net-next 2/5] net: dsa: add slave notify helper Vivien Didelot
2017-10-12 22:55 ` Florian Fainelli
2017-10-12 22:51 ` [PATCH net-next 3/5] net: dsa: add slave to port helper Vivien Didelot
2017-10-12 22:59 ` Florian Fainelli
2017-10-12 22:51 ` [PATCH net-next 4/5] net: dsa: add slave get master helper Vivien Didelot
2017-10-12 23:02 ` Florian Fainelli [this message]
2017-10-12 23:23 ` Vivien Didelot
2017-10-12 22:51 ` [PATCH net-next 5/5] net: dsa: split dsa_port's netdev member Vivien Didelot
2017-10-12 23:05 ` Florian Fainelli
2017-10-12 23:21 ` Vivien Didelot
2017-10-13 14:02 ` David Laight
2017-10-13 14:26 ` Vivien Didelot
2017-10-13 15:29 ` Vivien Didelot
2017-10-13 16:10 ` David Laight
2017-10-13 16:50 ` Vivien Didelot
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=e3e7001e-8618-0b31-cd28-ebcdad561f7b@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kernel@savoirfairelinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.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
Powered by JetHome