All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: dsa: Utilize dsa_slave_dev_check()
@ 2017-09-20  1:00 Florian Fainelli
  2017-09-20 14:19 ` Vivien Didelot
  2017-09-20 22:49 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Fainelli @ 2017-09-20  1:00 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Andrew Lunn, Vivien Didelot, David S. Miller,
	open list

Instead of open coding the check.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 net/dsa/slave.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index d51b10450e1b..6fc9eb094267 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1294,7 +1294,7 @@ static int dsa_slave_netdevice_event(struct notifier_block *nb,
 {
 	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
 
-	if (dev->netdev_ops != &dsa_slave_netdev_ops)
+	if (!dsa_slave_dev_check(dev))
 		return NOTIFY_DONE;
 
 	if (event == NETDEV_CHANGEUPPER)
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: dsa: Utilize dsa_slave_dev_check()
  2017-09-20  1:00 [PATCH net-next] net: dsa: Utilize dsa_slave_dev_check() Florian Fainelli
@ 2017-09-20 14:19 ` Vivien Didelot
  2017-09-20 22:49 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Vivien Didelot @ 2017-09-20 14:19 UTC (permalink / raw)
  To: Florian Fainelli, netdev
  Cc: Florian Fainelli, Andrew Lunn, David S. Miller, open list

Hi Florian,

Florian Fainelli <f.fainelli@gmail.com> writes:

> Instead of open coding the check.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

If we do need to use it outside one day, we may think about renaming
netdev_uses_dsa() to netdev_is_dsa_master() and renaming
dsa_slave_dev_check() to netdev_is_dsa_slave().

In the meantime, looks good!

Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: dsa: Utilize dsa_slave_dev_check()
  2017-09-20  1:00 [PATCH net-next] net: dsa: Utilize dsa_slave_dev_check() Florian Fainelli
  2017-09-20 14:19 ` Vivien Didelot
@ 2017-09-20 22:49 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-09-20 22:49 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, andrew, vivien.didelot, linux-kernel

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 19 Sep 2017 18:00:37 -0700

> Instead of open coding the check.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-20 22:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-20  1:00 [PATCH net-next] net: dsa: Utilize dsa_slave_dev_check() Florian Fainelli
2017-09-20 14:19 ` Vivien Didelot
2017-09-20 22:49 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.