aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-05-27 21:30:21 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-28 16:11:01 -0400
commit351638e7deeed2ec8ce451b53d33921b3da68f83 (patch)
tree175dfff289b5e3baecffbc7e97d1884e9a18345c /net
parentb1098bbe1b24d5d90cff92fbd716d2ef4bed2cff (diff)
net: pass info struct via netdevice notifier
So far, only net_device * could be passed along with netdevice notifier event. This patch provides a possibility to pass custom structure able to provide info that event listener needs to know. Signed-off-by: Jiri Pirko <jiri@resnulli.us> v2->v3: fix typo on simeth shortened dev_getter shortened notifier_info struct name v1->v2: fix notifier_call parameter in call_netdevice_notifier() Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/8021q/vlan.c2
-rw-r--r--net/appletalk/aarp.c2
-rw-r--r--net/appletalk/ddp.c2
-rw-r--r--net/atm/clip.c4
-rw-r--r--net/atm/mpc.c6
-rw-r--r--net/ax25/af_ax25.c6
-rw-r--r--net/batman-adv/hard-interface.c2
-rw-r--r--net/bridge/br_notify.c2
-rw-r--r--net/caif/caif_dev.c4
-rw-r--r--net/caif/caif_usb.c4
-rw-r--r--net/can/af_can.c4
-rw-r--r--net/can/bcm.c4
-rw-r--r--net/can/gw.c4
-rw-r--r--net/can/raw.c4
-rw-r--r--net/core/dev.c56
-rw-r--r--net/core/drop_monitor.c4
-rw-r--r--net/core/dst.c2
-rw-r--r--net/core/fib_rules.c4
-rw-r--r--net/core/netprio_cgroup.c2
-rw-r--r--net/core/pktgen.c2
-rw-r--r--net/core/rtnetlink.c2
-rw-r--r--net/decnet/af_decnet.c4
-rw-r--r--net/ieee802154/6lowpan.c5
-rw-r--r--net/ipv4/arp.c2
-rw-r--r--net/ipv4/devinet.c2
-rw-r--r--net/ipv4/fib_frontend.c2
-rw-r--r--net/ipv4/ipmr.c2
-rw-r--r--net/ipv4/netfilter/ipt_MASQUERADE.c2
-rw-r--r--net/ipv6/addrconf.c4
-rw-r--r--net/ipv6/ip6mr.c2
-rw-r--r--net/ipv6/ndisc.c2
-rw-r--r--net/ipv6/netfilter/ip6t_MASQUERADE.c2
-rw-r--r--net/ipv6/route.c4
-rw-r--r--net/ipx/af_ipx.c2
-rw-r--r--net/iucv/af_iucv.c2
-rw-r--r--net/mac80211/iface.c5
-rw-r--r--net/netfilter/ipvs/ip_vs_ctl.c4
-rw-r--r--net/netfilter/nfnetlink_queue_core.c2
-rw-r--r--net/netfilter/xt_TEE.c2
-rw-r--r--net/netlabel/netlabel_unlabeled.c7
-rw-r--r--net/netrom/af_netrom.c2
-rw-r--r--net/openvswitch/dp_notify.c2
-rw-r--r--net/packet/af_packet.c5
-rw-r--r--net/phonet/pn_dev.c4
-rw-r--r--net/rose/af_rose.c6
-rw-r--r--net/sched/act_mirred.c2
-rw-r--r--net/tipc/eth_media.c4
-rw-r--r--net/tipc/ib_media.c4
-rw-r--r--net/wireless/core.c5
-rw-r--r--net/x25/af_x25.c2
-rw-r--r--net/xfrm/xfrm_policy.c2
51 files changed, 124 insertions, 93 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 9424f3718ea7..2fb2d88e8c2e 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -341,7 +341,7 @@ static void __vlan_device_event(struct net_device *dev, unsigned long event)
341static int vlan_device_event(struct notifier_block *unused, unsigned long event, 341static int vlan_device_event(struct notifier_block *unused, unsigned long event,
342 void *ptr) 342 void *ptr)
343{ 343{
344 struct net_device *dev = ptr; 344 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
345 struct vlan_group *grp; 345 struct vlan_group *grp;
346 struct vlan_info *vlan_info; 346 struct vlan_info *vlan_info;
347 int i, flgs; 347 int i, flgs;
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index 173a2e82f486..690356fa52b9 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -332,7 +332,7 @@ static void aarp_expire_timeout(unsigned long unused)
332static int aarp_device_event(struct notifier_block *this, unsigned long event, 332static int aarp_device_event(struct notifier_block *this, unsigned long event,
333 void *ptr) 333 void *ptr)
334{ 334{
335 struct net_device *dev = ptr; 335 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
336 int ct; 336 int ct;
337 337
338 if (!net_eq(dev_net(dev), &init_net)) 338 if (!net_eq(dev_net(dev), &init_net))
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index ef12839a7cfe..7fee50d637f9 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -644,7 +644,7 @@ static inline void atalk_dev_down(struct net_device *dev)
644static int ddp_device_event(struct notifier_block *this, unsigned long event, 644static int ddp_device_event(struct notifier_block *this, unsigned long event,
645 void *ptr) 645 void *ptr)
646{ 646{
647 struct net_device *dev = ptr; 647 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
648 648
649 if (!net_eq(dev_net(dev), &init_net)) 649 if (!net_eq(dev_net(dev), &init_net))
650 return NOTIFY_DONE; 650 return NOTIFY_DONE;
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 8ae3a7879335..cce241eb01d9 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -539,9 +539,9 @@ static int clip_create(int number)
539} 539}
540 540
541static int clip_device_event(struct notifier_block *this, unsigned long event, 541static int clip_device_event(struct notifier_block *this, unsigned long event,
542 void *arg) 542 void *ptr)
543{ 543{
544 struct net_device *dev = arg; 544 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
545 545
546 if (!net_eq(dev_net(dev), &init_net)) 546 if (!net_eq(dev_net(dev), &init_net))
547 return NOTIFY_DONE; 547 return NOTIFY_DONE;
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index d4cc1be5c364..3af12755cd04 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -998,14 +998,12 @@ int msg_to_mpoad(struct k_message *mesg, struct mpoa_client *mpc)
998} 998}
999 999
1000static int mpoa_event_listener(struct notifier_block *mpoa_notifier, 1000static int mpoa_event_listener(struct notifier_block *mpoa_notifier,
1001 unsigned long event, void *dev_ptr) 1001 unsigned long event, void *ptr)
1002{ 1002{
1003 struct net_device *dev; 1003 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1004 struct mpoa_client *mpc; 1004 struct mpoa_client *mpc;
1005 struct lec_priv *priv; 1005 struct lec_priv *priv;
1006 1006
1007 dev = dev_ptr;
1008
1009 if (!net_eq(dev_net(dev), &init_net)) 1007 if (!net_eq(dev_net(dev), &init_net))
1010 return NOTIFY_DONE; 1008 return NOTIFY_DONE;
1011 1009
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index e277e38f736b..4b4d2b779ec1 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -111,9 +111,9 @@ again:
111 * Handle device status changes. 111 * Handle device status changes.
112 */ 112 */
113static int ax25_device_event(struct notifier_block *this, unsigned long event, 113static int ax25_device_event(struct notifier_block *this, unsigned long event,
114 void *ptr) 114 void *ptr)
115{ 115{
116 struct net_device *dev = (struct net_device *)ptr; 116 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
117 117
118 if (!net_eq(dev_net(dev), &init_net)) 118 if (!net_eq(dev_net(dev), &init_net))
119 return NOTIFY_DONE; 119 return NOTIFY_DONE;
@@ -1974,7 +1974,7 @@ static struct packet_type ax25_packet_type __read_mostly = {
1974}; 1974};
1975 1975
1976static struct notifier_block ax25_dev_notifier = { 1976static struct notifier_block ax25_dev_notifier = {
1977 .notifier_call =ax25_device_event, 1977 .notifier_call = ax25_device_event,
1978}; 1978};
1979 1979
1980static int __init ax25_init(void) 1980static int __init ax25_init(void)
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 522243aff2f3..b6504eac0ed8 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -595,7 +595,7 @@ void batadv_hardif_remove_interfaces(void)
595static int batadv_hard_if_event(struct notifier_block *this, 595static int batadv_hard_if_event(struct notifier_block *this,
596 unsigned long event, void *ptr) 596 unsigned long event, void *ptr)
597{ 597{
598 struct net_device *net_dev = ptr; 598 struct net_device *net_dev = netdev_notifier_info_to_dev(ptr);
599 struct batadv_hard_iface *hard_iface; 599 struct batadv_hard_iface *hard_iface;
600 struct batadv_hard_iface *primary_if = NULL; 600 struct batadv_hard_iface *primary_if = NULL;
601 struct batadv_priv *bat_priv; 601 struct batadv_priv *bat_priv;
diff --git a/net/bridge/br_notify.c b/net/bridge/br_notify.c
index 1644b3e1f947..3a3f371b2841 100644
--- a/net/bridge/br_notify.c
+++ b/net/bridge/br_notify.c
@@ -31,7 +31,7 @@ struct notifier_block br_device_notifier = {
31 */ 31 */
32static int br_device_event(struct notifier_block *unused, unsigned long event, void *ptr) 32static int br_device_event(struct notifier_block *unused, unsigned long event, void *ptr)
33{ 33{
34 struct net_device *dev = ptr; 34 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
35 struct net_bridge_port *p; 35 struct net_bridge_port *p;
36 struct net_bridge *br; 36 struct net_bridge *br;
37 bool changed_addr; 37 bool changed_addr;
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
index 1f9ece1a9c34..4dca159435cf 100644
--- a/net/caif/caif_dev.c
+++ b/net/caif/caif_dev.c
@@ -352,9 +352,9 @@ EXPORT_SYMBOL(caif_enroll_dev);
352 352
353/* notify Caif of device events */ 353/* notify Caif of device events */
354static int caif_device_notify(struct notifier_block *me, unsigned long what, 354static int caif_device_notify(struct notifier_block *me, unsigned long what,
355 void *arg) 355 void *ptr)
356{ 356{
357 struct net_device *dev = arg; 357 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
358 struct caif_device_entry *caifd = NULL; 358 struct caif_device_entry *caifd = NULL;
359 struct caif_dev_common *caifdev; 359 struct caif_dev_common *caifdev;
360 struct cfcnfg *cfg; 360 struct cfcnfg *cfg;
diff --git a/net/caif/caif_usb.c b/net/caif/caif_usb.c
index 942e00a425fd..75ed04b78fa4 100644
--- a/net/caif/caif_usb.c
+++ b/net/caif/caif_usb.c
@@ -121,9 +121,9 @@ static struct packet_type caif_usb_type __read_mostly = {
121}; 121};
122 122
123static int cfusbl_device_notify(struct notifier_block *me, unsigned long what, 123static int cfusbl_device_notify(struct notifier_block *me, unsigned long what,
124 void *arg) 124 void *ptr)
125{ 125{
126 struct net_device *dev = arg; 126 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
127 struct caif_dev_common common; 127 struct caif_dev_common common;
128 struct cflayer *layer, *link_support; 128 struct cflayer *layer, *link_support;
129 struct usbnet *usbnet; 129 struct usbnet *usbnet;
diff --git a/net/can/af_can.c b/net/can/af_can.c
index c4e50852c9f4..3ab8dd2e1282 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -794,9 +794,9 @@ EXPORT_SYMBOL(can_proto_unregister);
794 * af_can notifier to create/remove CAN netdevice specific structs 794 * af_can notifier to create/remove CAN netdevice specific structs
795 */ 795 */
796static int can_notifier(struct notifier_block *nb, unsigned long msg, 796static int can_notifier(struct notifier_block *nb, unsigned long msg,
797 void *data) 797 void *ptr)
798{ 798{
799 struct net_device *dev = (struct net_device *)data; 799 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
800 struct dev_rcv_lists *d; 800 struct dev_rcv_lists *d;
801 801
802 if (!net_eq(dev_net(dev), &init_net)) 802 if (!net_eq(dev_net(dev), &init_net))
diff --git a/net/can/bcm.c b/net/can/bcm.c
index 8f113e6ff327..46f20bfafc0e 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -1350,9 +1350,9 @@ static int bcm_sendmsg(struct kiocb *iocb, struct socket *sock,
1350 * notification handler for netdevice status changes 1350 * notification handler for netdevice status changes
1351 */ 1351 */
1352static int bcm_notifier(struct notifier_block *nb, unsigned long msg, 1352static int bcm_notifier(struct notifier_block *nb, unsigned long msg,
1353 void *data) 1353 void *ptr)
1354{ 1354{
1355 struct net_device *dev = (struct net_device *)data; 1355 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1356 struct bcm_sock *bo = container_of(nb, struct bcm_sock, notifier); 1356 struct bcm_sock *bo = container_of(nb, struct bcm_sock, notifier);
1357 struct sock *sk = &bo->sk; 1357 struct sock *sk = &bo->sk;
1358 struct bcm_op *op; 1358 struct bcm_op *op;
diff --git a/net/can/gw.c b/net/can/gw.c
index 3ee690e8c7d3..2f291f961a17 100644
--- a/net/can/gw.c
+++ b/net/can/gw.c
@@ -445,9 +445,9 @@ static inline void cgw_unregister_filter(struct cgw_job *gwj)
445} 445}
446 446
447static int cgw_notifier(struct notifier_block *nb, 447static int cgw_notifier(struct notifier_block *nb,
448 unsigned long msg, void *data) 448 unsigned long msg, void *ptr)
449{ 449{
450 struct net_device *dev = (struct net_device *)data; 450 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
451 451
452 if (!net_eq(dev_net(dev), &init_net)) 452 if (!net_eq(dev_net(dev), &init_net))
453 return NOTIFY_DONE; 453 return NOTIFY_DONE;
diff --git a/net/can/raw.c b/net/can/raw.c
index 1085e65f848e..641e1c895123 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -239,9 +239,9 @@ static int raw_enable_allfilters(struct net_device *dev, struct sock *sk)
239} 239}
240 240
241static int raw_notifier(struct notifier_block *nb, 241static int raw_notifier(struct notifier_block *nb,
242 unsigned long msg, void *data) 242 unsigned long msg, void *ptr)
243{ 243{
244 struct net_device *dev = (struct net_device *)data; 244 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
245 struct raw_sock *ro = container_of(nb, struct raw_sock, notifier); 245 struct raw_sock *ro = container_of(nb, struct raw_sock, notifier);
246 struct sock *sk = &ro->sk; 246 struct sock *sk = &ro->sk;
247 247
diff --git a/net/core/dev.c b/net/core/dev.c
index 5f747974ac58..54fce6006a83 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1391,6 +1391,20 @@ void dev_disable_lro(struct net_device *dev)
1391} 1391}
1392EXPORT_SYMBOL(dev_disable_lro); 1392EXPORT_SYMBOL(dev_disable_lro);
1393 1393
1394static void netdev_notifier_info_init(struct netdev_notifier_info *info,
1395 struct net_device *dev)
1396{
1397 info->dev = dev;
1398}
1399
1400static int call_netdevice_notifier(struct notifier_block *nb, unsigned long val,
1401 struct net_device *dev)
1402{
1403 struct netdev_notifier_info info;
1404
1405 netdev_notifier_info_init(&info, dev);
1406 return nb->notifier_call(nb, val, &info);
1407}
1394 1408
1395static int dev_boot_phase = 1; 1409static int dev_boot_phase = 1;
1396 1410
@@ -1423,7 +1437,7 @@ int register_netdevice_notifier(struct notifier_block *nb)
1423 goto unlock; 1437 goto unlock;
1424 for_each_net(net) { 1438 for_each_net(net) {
1425 for_each_netdev(net, dev) { 1439 for_each_netdev(net, dev) {
1426 err = nb->notifier_call(nb, NETDEV_REGISTER, dev); 1440 err = call_netdevice_notifier(nb, NETDEV_REGISTER, dev);
1427 err = notifier_to_errno(err); 1441 err = notifier_to_errno(err);
1428 if (err) 1442 if (err)
1429 goto rollback; 1443 goto rollback;
@@ -1431,7 +1445,7 @@ int register_netdevice_notifier(struct notifier_block *nb)
1431 if (!(dev->flags & IFF_UP)) 1445 if (!(dev->flags & IFF_UP))
1432 continue; 1446 continue;
1433 1447
1434 nb->notifier_call(nb, NETDEV_UP, dev); 1448 call_netdevice_notifier(nb, NETDEV_UP, dev);
1435 } 1449 }
1436 } 1450 }
1437 1451
@@ -1447,10 +1461,11 @@ rollback:
1447 goto outroll; 1461 goto outroll;
1448 1462
1449 if (dev->flags & IFF_UP) { 1463 if (dev->flags & IFF_UP) {
1450 nb->notifier_call(nb, NETDEV_GOING_DOWN, dev); 1464 call_netdevice_notifier(nb, NETDEV_GOING_DOWN,
1451 nb->notifier_call(nb, NETDEV_DOWN, dev); 1465 dev);
1466 call_netdevice_notifier(nb, NETDEV_DOWN, dev);
1452 } 1467 }
1453 nb->notifier_call(nb, NETDEV_UNREGISTER, dev); 1468 call_netdevice_notifier(nb, NETDEV_UNREGISTER, dev);
1454 } 1469 }
1455 } 1470 }
1456 1471
@@ -1488,10 +1503,11 @@ int unregister_netdevice_notifier(struct notifier_block *nb)
1488 for_each_net(net) { 1503 for_each_net(net) {
1489 for_each_netdev(net, dev) { 1504 for_each_netdev(net, dev) {
1490 if (dev->flags & IFF_UP) { 1505 if (dev->flags & IFF_UP) {
1491 nb->notifier_call(nb, NETDEV_GOING_DOWN, dev); 1506 call_netdevice_notifier(nb, NETDEV_GOING_DOWN,
1492 nb->notifier_call(nb, NETDEV_DOWN, dev); 1507 dev);
1508 call_netdevice_notifier(nb, NETDEV_DOWN, dev);
1493 } 1509 }
1494 nb->notifier_call(nb, NETDEV_UNREGISTER, dev); 1510 call_netdevice_notifier(nb, NETDEV_UNREGISTER, dev);
1495 } 1511 }
1496 } 1512 }
1497unlock: 1513unlock:
@@ -1501,6 +1517,25 @@ unlock:
1501EXPORT_SYMBOL(unregister_netdevice_notifier); 1517EXPORT_SYMBOL(unregister_netdevice_notifier);
1502 1518
1503/** 1519/**
1520 * call_netdevice_notifiers_info - call all network notifier blocks
1521 * @val: value passed unmodified to notifier function
1522 * @dev: net_device pointer passed unmodified to notifier function
1523 * @info: notifier information data
1524 *
1525 * Call all network notifier blocks. Parameters and return value
1526 * are as for raw_notifier_call_chain().
1527 */
1528
1529int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev,
1530 struct netdev_notifier_info *info)
1531{
1532 ASSERT_RTNL();
1533 netdev_notifier_info_init(info, dev);
1534 return raw_notifier_call_chain(&netdev_chain, val, info);
1535}
1536EXPORT_SYMBOL(call_netdevice_notifiers_info);
1537
1538/**
1504 * call_netdevice_notifiers - call all network notifier blocks 1539 * call_netdevice_notifiers - call all network notifier blocks
1505 * @val: value passed unmodified to notifier function 1540 * @val: value passed unmodified to notifier function
1506 * @dev: net_device pointer passed unmodified to notifier function 1541 * @dev: net_device pointer passed unmodified to notifier function
@@ -1511,8 +1546,9 @@ EXPORT_SYMBOL(unregister_netdevice_notifier);
1511 1546
1512int call_netdevice_notifiers(unsigned long val, struct net_device *dev) 1547int call_netdevice_notifiers(unsigned long val, struct net_device *dev)
1513{ 1548{
1514 ASSERT_RTNL(); 1549 struct netdev_notifier_info info;
1515 return raw_notifier_call_chain(&netdev_chain, val, dev); 1550
1551 return call_netdevice_notifiers_info(val, dev, &info);
1516} 1552}
1517EXPORT_SYMBOL(call_netdevice_notifiers); 1553EXPORT_SYMBOL(call_netdevice_notifiers);
1518 1554
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index d23b6682f4e9..5e78d44333b9 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -295,9 +295,9 @@ static int net_dm_cmd_trace(struct sk_buff *skb,
295} 295}
296 296
297static int dropmon_net_event(struct notifier_block *ev_block, 297static int dropmon_net_event(struct notifier_block *ev_block,
298 unsigned long event, void *ptr) 298 unsigned long event, void *ptr)
299{ 299{
300 struct net_device *dev = ptr; 300 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
301 struct dm_hw_stat_delta *new_stat = NULL; 301 struct dm_hw_stat_delta *new_stat = NULL;
302 struct dm_hw_stat_delta *tmp; 302 struct dm_hw_stat_delta *tmp;
303 303
diff --git a/net/core/dst.c b/net/core/dst.c
index df9cc810ec8e..ca4231ec7347 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -372,7 +372,7 @@ static void dst_ifdown(struct dst_entry *dst, struct net_device *dev,
372static int dst_dev_event(struct notifier_block *this, unsigned long event, 372static int dst_dev_event(struct notifier_block *this, unsigned long event,
373 void *ptr) 373 void *ptr)
374{ 374{
375 struct net_device *dev = ptr; 375 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
376 struct dst_entry *dst, *last = NULL; 376 struct dst_entry *dst, *last = NULL;
377 377
378 switch (event) { 378 switch (event) {
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index d5a9f8ead0d8..21735440c44a 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -705,9 +705,9 @@ static void detach_rules(struct list_head *rules, struct net_device *dev)
705 705
706 706
707static int fib_rules_event(struct notifier_block *this, unsigned long event, 707static int fib_rules_event(struct notifier_block *this, unsigned long event,
708 void *ptr) 708 void *ptr)
709{ 709{
710 struct net_device *dev = ptr; 710 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
711 struct net *net = dev_net(dev); 711 struct net *net = dev_net(dev);
712 struct fib_rules_ops *ops; 712 struct fib_rules_ops *ops;
713 713
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
index 0777d0aa18c3..e533259dce3c 100644
--- a/net/core/netprio_cgroup.c
+++ b/net/core/netprio_cgroup.c
@@ -261,7 +261,7 @@ struct cgroup_subsys net_prio_subsys = {
261static int netprio_device_event(struct notifier_block *unused, 261static int netprio_device_event(struct notifier_block *unused,
262 unsigned long event, void *ptr) 262 unsigned long event, void *ptr)
263{ 263{
264 struct net_device *dev = ptr; 264 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
265 struct netprio_map *old; 265 struct netprio_map *old;
266 266
267 /* 267 /*
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 11f2704c3810..795498fd4587 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1921,7 +1921,7 @@ static void pktgen_change_name(const struct pktgen_net *pn, struct net_device *d
1921static int pktgen_device_event(struct notifier_block *unused, 1921static int pktgen_device_event(struct notifier_block *unused,
1922 unsigned long event, void *ptr) 1922 unsigned long event, void *ptr)
1923{ 1923{
1924 struct net_device *dev = ptr; 1924 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1925 struct pktgen_net *pn = net_generic(dev_net(dev), pg_net_id); 1925 struct pktgen_net *pn = net_generic(dev_net(dev), pg_net_id);
1926 1926
1927 if (pn->pktgen_exiting) 1927 if (pn->pktgen_exiting)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index a08bd2b7fe3f..49c14451d8ab 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2667,7 +2667,7 @@ static void rtnetlink_rcv(struct sk_buff *skb)
2667 2667
2668static int rtnetlink_event(struct notifier_block *this, unsigned long event, void *ptr) 2668static int rtnetlink_event(struct notifier_block *this, unsigned long event, void *ptr)
2669{ 2669{
2670 struct net_device *dev = ptr; 2670 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
2671 2671
2672 switch (event) { 2672 switch (event) {
2673 case NETDEV_UP: 2673 case NETDEV_UP:
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index c21f200eed93..dd4d506ef923 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -2078,9 +2078,9 @@ out_err:
2078} 2078}
2079 2079
2080static int dn_device_event(struct notifier_block *this, unsigned long event, 2080static int dn_device_event(struct notifier_block *this, unsigned long event,
2081 void *ptr) 2081 void *ptr)
2082{ 2082{
2083 struct net_device *dev = (struct net_device *)ptr; 2083 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
2084 2084
2085 if (!net_eq(dev_net(dev), &init_net)) 2085 if (!net_eq(dev_net(dev), &init_net))
2086 return NOTIFY_DONE; 2086 return NOTIFY_DONE;
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 55e1fd5b3e56..3b9d5f20bd1c 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -1352,10 +1352,9 @@ static inline void lowpan_netlink_fini(void)
1352} 1352}
1353 1353
1354static int lowpan_device_event(struct notifier_block *unused, 1354static int lowpan_device_event(struct notifier_block *unused,
1355 unsigned long event, 1355 unsigned long event, void *ptr)
1356 void *ptr)
1357{ 1356{
1358 struct net_device *dev = ptr; 1357 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1359 LIST_HEAD(del_list); 1358 LIST_HEAD(del_list);
1360 struct lowpan_dev_record *entry, *tmp; 1359 struct lowpan_dev_record *entry, *tmp;
1361 1360
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 247ec1951c35..bf574029a183 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1234,7 +1234,7 @@ out:
1234static int arp_netdev_event(struct notifier_block *this, unsigned long event, 1234static int arp_netdev_event(struct notifier_block *this, unsigned long event,
1235 void *ptr) 1235 void *ptr)
1236{ 1236{
1237 struct net_device *dev = ptr; 1237 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1238 1238
1239 switch (event) { 1239 switch (event) {
1240 case NETDEV_CHANGEADDR: 1240 case NETDEV_CHANGEADDR:
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index dfc39d4d48b7..b047e2d8a614 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1333,7 +1333,7 @@ static void inetdev_send_gratuitous_arp(struct net_device *dev,
1333static int inetdev_event(struct notifier_block *this, unsigned long event, 1333static int inetdev_event(struct notifier_block *this, unsigned long event,
1334 void *ptr) 1334 void *ptr)
1335{ 1335{
1336 struct net_device *dev = ptr; 1336 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1337 struct in_device *in_dev = __in_dev_get_rtnl(dev); 1337 struct in_device *in_dev = __in_dev_get_rtnl(dev);
1338 1338
1339 ASSERT_RTNL(); 1339 ASSERT_RTNL();
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index c7629a209f9d..05a4888dede9 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1038,7 +1038,7 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event,
1038 1038
1039static int fib_netdev_event(struct notifier_block *this, unsigned long event, void *ptr) 1039static int fib_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
1040{ 1040{
1041 struct net_device *dev = ptr; 1041 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1042 struct in_device *in_dev; 1042 struct in_device *in_dev;
1043 struct net *net = dev_net(dev); 1043 struct net *net = dev_net(dev);
1044 1044
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 9d9610ae7855..f975399f3522 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1609,7 +1609,7 @@ int ipmr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
1609 1609
1610static int ipmr_device_event(struct notifier_block *this, unsigned long event, void *ptr) 1610static int ipmr_device_event(struct notifier_block *this, unsigned long event, void *ptr)
1611{ 1611{
1612 struct net_device *dev = ptr; 1612 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1613 struct net *net = dev_net(dev); 1613 struct net *net = dev_net(dev);
1614 struct mr_table *mrt; 1614 struct mr_table *mrt;
1615 struct vif_device *v; 1615 struct vif_device *v;
diff --git a/net/ipv4/netfilter/ipt_MASQUERADE.c b/net/ipv4/netfilter/ipt_MASQUERADE.c
index 5d5d4d1be9c2..dd5508bde799 100644
--- a/net/ipv4/netfilter/ipt_MASQUERADE.c
+++ b/net/ipv4/netfilter/ipt_MASQUERADE.c
@@ -108,7 +108,7 @@ static int masq_device_event(struct notifier_block *this,
108 unsigned long event, 108 unsigned long event,
109 void *ptr) 109 void *ptr)
110{ 110{
111 const struct net_device *dev = ptr; 111 const struct net_device *dev = netdev_notifier_info_to_dev(ptr);
112 struct net *net = dev_net(dev); 112 struct net *net = dev_net(dev);
113 113
114 if (event == NETDEV_DOWN) { 114 if (event == NETDEV_DOWN) {
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 432e084b6b62..bce073b4bbd4 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2826,9 +2826,9 @@ static void addrconf_ip6_tnl_config(struct net_device *dev)
2826} 2826}
2827 2827
2828static int addrconf_notify(struct notifier_block *this, unsigned long event, 2828static int addrconf_notify(struct notifier_block *this, unsigned long event,
2829 void *data) 2829 void *ptr)
2830{ 2830{
2831 struct net_device *dev = (struct net_device *) data; 2831 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
2832 struct inet6_dev *idev = __in6_dev_get(dev); 2832 struct inet6_dev *idev = __in6_dev_get(dev);
2833 int run_pending = 0; 2833 int run_pending = 0;
2834 int err; 2834 int err;
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 241fb8ad9fcf..583e8d435f9a 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1319,7 +1319,7 @@ static int ip6mr_mfc_delete(struct mr6_table *mrt, struct mf6cctl *mfc,
1319static int ip6mr_device_event(struct notifier_block *this, 1319static int ip6mr_device_event(struct notifier_block *this,
1320 unsigned long event, void *ptr) 1320 unsigned long event, void *ptr)
1321{ 1321{
1322 struct net_device *dev = ptr; 1322 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1323 struct net *net = dev_net(dev); 1323 struct net *net = dev_net(dev);
1324 struct mr6_table *mrt; 1324 struct mr6_table *mrt;
1325 struct mif_device *v; 1325 struct mif_device *v;
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 2712ab22a174..a0962697a257 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1568,7 +1568,7 @@ int ndisc_rcv(struct sk_buff *skb)
1568 1568
1569static int ndisc_netdev_event(struct notifier_block *this, unsigned long event, void *ptr) 1569static int ndisc_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
1570{ 1570{
1571 struct net_device *dev = ptr; 1571 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1572 struct net *net = dev_net(dev); 1572 struct net *net = dev_net(dev);
1573 struct inet6_dev *idev; 1573 struct inet6_dev *idev;
1574 1574
diff --git a/net/ipv6/netfilter/ip6t_MASQUERADE.c b/net/ipv6/netfilter/ip6t_MASQUERADE.c
index 60e9053bab05..b76257cd7e1e 100644
--- a/net/ipv6/netfilter/ip6t_MASQUERADE.c
+++ b/net/ipv6/netfilter/ip6t_MASQUERADE.c
@@ -71,7 +71,7 @@ static int device_cmp(struct nf_conn *ct, void *ifindex)
71static int masq_device_event(struct notifier_block *this, 71static int masq_device_event(struct notifier_block *this,
72 unsigned long event, void *ptr) 72 unsigned long event, void *ptr)
73{ 73{
74 const struct net_device *dev = ptr; 74 const struct net_device *dev = netdev_notifier_info_to_dev(ptr);
75 struct net *net = dev_net(dev); 75 struct net *net = dev_net(dev);
76 76
77 if (event == NETDEV_DOWN) 77 if (event == NETDEV_DOWN)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index ad0aa6b0b86a..194c3cde1536 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2681,9 +2681,9 @@ errout:
2681} 2681}
2682 2682
2683static int ip6_route_dev_notify(struct notifier_block *this, 2683static int ip6_route_dev_notify(struct notifier_block *this,
2684 unsigned long event, void *data) 2684 unsigned long event, void *ptr)
2685{ 2685{
2686 struct net_device *dev = (struct net_device *)data; 2686 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
2687 struct net *net = dev_net(dev); 2687 struct net *net = dev_net(dev);
2688 2688
2689 if (event == NETDEV_REGISTER && (dev->flags & IFF_LOOPBACK)) { 2689 if (event == NETDEV_REGISTER && (dev->flags & IFF_LOOPBACK)) {
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index f547a47d381c..7a1e0fc1bd4d 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -330,7 +330,7 @@ static __inline__ void __ipxitf_put(struct ipx_interface *intrfc)
330static int ipxitf_device_event(struct notifier_block *notifier, 330static int ipxitf_device_event(struct notifier_block *notifier,
331 unsigned long event, void *ptr) 331 unsigned long event, void *ptr)
332{ 332{
333 struct net_device *dev = ptr; 333 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
334 struct ipx_interface *i, *tmp; 334 struct ipx_interface *i, *tmp;
335 335
336 if (!net_eq(dev_net(dev), &init_net)) 336 if (!net_eq(dev_net(dev), &init_net))
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index ae691651b721..168aff5e60de 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -2293,7 +2293,7 @@ out_unlock:
2293static int afiucv_netdev_event(struct notifier_block *this, 2293static int afiucv_netdev_event(struct notifier_block *this,
2294 unsigned long event, void *ptr) 2294 unsigned long event, void *ptr)
2295{ 2295{
2296 struct net_device *event_dev = (struct net_device *)ptr; 2296 struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
2297 struct sock *sk; 2297 struct sock *sk;
2298 struct iucv_sock *iucv; 2298 struct iucv_sock *iucv;
2299 2299
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 60f1ce5e5e52..d2c3fd178dbe 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1717,10 +1717,9 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local)
1717} 1717}
1718 1718
1719static int netdev_notify(struct notifier_block *nb, 1719static int netdev_notify(struct notifier_block *nb,
1720 unsigned long state, 1720 unsigned long state, void *ptr)
1721 void *ndev)
1722{ 1721{
1723 struct net_device *dev = ndev; 1722 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1724 struct ieee80211_sub_if_data *sdata; 1723 struct ieee80211_sub_if_data *sdata;
1725 1724
1726 if (state != NETDEV_CHANGENAME) 1725 if (state != NETDEV_CHANGENAME)
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 5b142fb16480..7c3ed429789e 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -1487,9 +1487,9 @@ ip_vs_forget_dev(struct ip_vs_dest *dest, struct net_device *dev)
1487 * Currently only NETDEV_DOWN is handled to release refs to cached dsts 1487 * Currently only NETDEV_DOWN is handled to release refs to cached dsts
1488 */ 1488 */
1489static int ip_vs_dst_event(struct notifier_block *this, unsigned long event, 1489static int ip_vs_dst_event(struct notifier_block *this, unsigned long event,
1490 void *ptr) 1490 void *ptr)
1491{ 1491{
1492 struct net_device *dev = ptr; 1492 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1493 struct net *net = dev_net(dev); 1493 struct net *net = dev_net(dev);
1494 struct netns_ipvs *ipvs = net_ipvs(net); 1494 struct netns_ipvs *ipvs = net_ipvs(net);
1495 struct ip_vs_service *svc; 1495 struct ip_vs_service *svc;
diff --git a/net/netfilter/nfnetlink_queue_core.c b/net/netfilter/nfnetlink_queue_core.c
index 4e27fa035814..0f2ac8f2e7b7 100644
--- a/net/netfilter/nfnetlink_queue_core.c
+++ b/net/netfilter/nfnetlink_queue_core.c
@@ -800,7 +800,7 @@ static int
800nfqnl_rcv_dev_event(struct notifier_block *this, 800nfqnl_rcv_dev_event(struct notifier_block *this,
801 unsigned long event, void *ptr) 801 unsigned long event, void *ptr)
802{ 802{
803 struct net_device *dev = ptr; 803 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
804 804
805 /* Drop any packets associated with the downed device */ 805 /* Drop any packets associated with the downed device */
806 if (event == NETDEV_DOWN) 806 if (event == NETDEV_DOWN)
diff --git a/net/netfilter/xt_TEE.c b/net/netfilter/xt_TEE.c
index bd93e51d30ac..292934d23482 100644
--- a/net/netfilter/xt_TEE.c
+++ b/net/netfilter/xt_TEE.c
@@ -200,7 +200,7 @@ tee_tg6(struct sk_buff *skb, const struct xt_action_param *par)
200static int tee_netdev_event(struct notifier_block *this, unsigned long event, 200static int tee_netdev_event(struct notifier_block *this, unsigned long event,
201 void *ptr) 201 void *ptr)
202{ 202{
203 struct net_device *dev = ptr; 203 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
204 struct xt_tee_priv *priv; 204 struct xt_tee_priv *priv;
205 205
206 priv = container_of(this, struct xt_tee_priv, notifier); 206 priv = container_of(this, struct xt_tee_priv, notifier);
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index 8a6c6ea466d8..af3531926ee0 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -708,7 +708,7 @@ unlhsh_remove_return:
708 * netlbl_unlhsh_netdev_handler - Network device notification handler 708 * netlbl_unlhsh_netdev_handler - Network device notification handler
709 * @this: notifier block 709 * @this: notifier block
710 * @event: the event 710 * @event: the event
711 * @ptr: the network device (cast to void) 711 * @ptr: the netdevice notifier info (cast to void)
712 * 712 *
713 * Description: 713 * Description:
714 * Handle network device events, although at present all we care about is a 714 * Handle network device events, although at present all we care about is a
@@ -717,10 +717,9 @@ unlhsh_remove_return:
717 * 717 *
718 */ 718 */
719static int netlbl_unlhsh_netdev_handler(struct notifier_block *this, 719static int netlbl_unlhsh_netdev_handler(struct notifier_block *this,
720 unsigned long event, 720 unsigned long event, void *ptr)
721 void *ptr)
722{ 721{
723 struct net_device *dev = ptr; 722 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
724 struct netlbl_unlhsh_iface *iface = NULL; 723 struct netlbl_unlhsh_iface *iface = NULL;
725 724
726 if (!net_eq(dev_net(dev), &init_net)) 725 if (!net_eq(dev_net(dev), &init_net))
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index ec0c80fde69f..698814bfa7ad 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -117,7 +117,7 @@ static void nr_kill_by_device(struct net_device *dev)
117 */ 117 */
118static int nr_device_event(struct notifier_block *this, unsigned long event, void *ptr) 118static int nr_device_event(struct notifier_block *this, unsigned long event, void *ptr)
119{ 119{
120 struct net_device *dev = (struct net_device *)ptr; 120 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
121 121
122 if (!net_eq(dev_net(dev), &init_net)) 122 if (!net_eq(dev_net(dev), &init_net))
123 return NOTIFY_DONE; 123 return NOTIFY_DONE;
diff --git a/net/openvswitch/dp_notify.c b/net/openvswitch/dp_notify.c
index ef4feec6cd84..c3235675f359 100644
--- a/net/openvswitch/dp_notify.c
+++ b/net/openvswitch/dp_notify.c
@@ -78,7 +78,7 @@ static int dp_device_event(struct notifier_block *unused, unsigned long event,
78 void *ptr) 78 void *ptr)
79{ 79{
80 struct ovs_net *ovs_net; 80 struct ovs_net *ovs_net;
81 struct net_device *dev = ptr; 81 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
82 struct vport *vport = NULL; 82 struct vport *vport = NULL;
83 83
84 if (!ovs_is_internal_dev(dev)) 84 if (!ovs_is_internal_dev(dev))
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 8ec1bca7f859..79fe63246b27 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -3331,10 +3331,11 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
3331} 3331}
3332 3332
3333 3333
3334static int packet_notifier(struct notifier_block *this, unsigned long msg, void *data) 3334static int packet_notifier(struct notifier_block *this,
3335 unsigned long msg, void *ptr)
3335{ 3336{
3336 struct sock *sk; 3337 struct sock *sk;
3337 struct net_device *dev = data; 3338 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
3338 struct net *net = dev_net(dev); 3339 struct net *net = dev_net(dev);
3339 3340
3340 rcu_read_lock(); 3341 rcu_read_lock();
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index 45a7df6575de..56a6146ac94b 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -292,9 +292,9 @@ static void phonet_route_autodel(struct net_device *dev)
292 292
293/* notify Phonet of device events */ 293/* notify Phonet of device events */
294static int phonet_device_notify(struct notifier_block *me, unsigned long what, 294static int phonet_device_notify(struct notifier_block *me, unsigned long what,
295 void *arg) 295 void *ptr)
296{ 296{
297 struct net_device *dev = arg; 297 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
298 298
299 switch (what) { 299 switch (what) {
300 case NETDEV_REGISTER: 300 case NETDEV_REGISTER:
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 9c8347451597..e98fcfbe6007 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -202,10 +202,10 @@ static void rose_kill_by_device(struct net_device *dev)
202/* 202/*
203 * Handle device status changes. 203 * Handle device status changes.
204 */ 204 */
205static int rose_device_event(struct notifier_block *this, unsigned long event, 205static int rose_device_event(struct notifier_block *this,
206 void *ptr) 206 unsigned long event, void *ptr)
207{ 207{
208 struct net_device *dev = (struct net_device *)ptr; 208 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
209 209
210 if (!net_eq(dev_net(dev), &init_net)) 210 if (!net_eq(dev_net(dev), &init_net))
211 return NOTIFY_DONE; 211 return NOTIFY_DONE;
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 5d676edc22a6..977c10e0631b 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -243,7 +243,7 @@ nla_put_failure:
243static int mirred_device_event(struct notifier_block *unused, 243static int mirred_device_event(struct notifier_block *unused,
244 unsigned long event, void *ptr) 244 unsigned long event, void *ptr)
245{ 245{
246 struct net_device *dev = ptr; 246 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
247 struct tcf_mirred *m; 247 struct tcf_mirred *m;
248 248
249 if (event == NETDEV_UNREGISTER) 249 if (event == NETDEV_UNREGISTER)
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 120a676a3360..fc60bea63169 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -251,9 +251,9 @@ static void disable_bearer(struct tipc_bearer *tb_ptr)
251 * specified device. 251 * specified device.
252 */ 252 */
253static int recv_notification(struct notifier_block *nb, unsigned long evt, 253static int recv_notification(struct notifier_block *nb, unsigned long evt,
254 void *dv) 254 void *ptr)
255{ 255{
256 struct net_device *dev = (struct net_device *)dv; 256 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
257 struct eth_bearer *eb_ptr = &eth_bearers[0]; 257 struct eth_bearer *eb_ptr = &eth_bearers[0];
258 struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS]; 258 struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS];
259 259
diff --git a/net/tipc/ib_media.c b/net/tipc/ib_media.c
index 2a2864c25e15..baa9df4327d9 100644
--- a/net/tipc/ib_media.c
+++ b/net/tipc/ib_media.c
@@ -244,9 +244,9 @@ static void disable_bearer(struct tipc_bearer *tb_ptr)
244 * specified device. 244 * specified device.
245 */ 245 */
246static int recv_notification(struct notifier_block *nb, unsigned long evt, 246static int recv_notification(struct notifier_block *nb, unsigned long evt,
247 void *dv) 247 void *ptr)
248{ 248{
249 struct net_device *dev = (struct net_device *)dv; 249 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
250 struct ib_bearer *ib_ptr = &ib_bearers[0]; 250 struct ib_bearer *ib_ptr = &ib_bearers[0];
251 struct ib_bearer *stop = &ib_bearers[MAX_IB_BEARERS]; 251 struct ib_bearer *stop = &ib_bearers[MAX_IB_BEARERS];
252 252
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 73405e00c800..01e41191f1bf 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -886,10 +886,9 @@ void cfg80211_leave(struct cfg80211_registered_device *rdev,
886} 886}
887 887
888static int cfg80211_netdev_notifier_call(struct notifier_block *nb, 888static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
889 unsigned long state, 889 unsigned long state, void *ptr)
890 void *ndev)
891{ 890{
892 struct net_device *dev = ndev; 891 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
893 struct wireless_dev *wdev = dev->ieee80211_ptr; 892 struct wireless_dev *wdev = dev->ieee80211_ptr;
894 struct cfg80211_registered_device *rdev; 893 struct cfg80211_registered_device *rdev;
895 int ret; 894 int ret;
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 37ca9694aabe..1d964e23853f 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -224,7 +224,7 @@ static void x25_kill_by_device(struct net_device *dev)
224static int x25_device_event(struct notifier_block *this, unsigned long event, 224static int x25_device_event(struct notifier_block *this, unsigned long event,
225 void *ptr) 225 void *ptr)
226{ 226{
227 struct net_device *dev = ptr; 227 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
228 struct x25_neigh *nb; 228 struct x25_neigh *nb;
229 229
230 if (!net_eq(dev_net(dev), &init_net)) 230 if (!net_eq(dev_net(dev), &init_net))
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 23cea0f74336..536ccc95de89 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2784,7 +2784,7 @@ static void __net_init xfrm_dst_ops_init(struct net *net)
2784 2784
2785static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void *ptr) 2785static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void *ptr)
2786{ 2786{
2787 struct net_device *dev = ptr; 2787 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
2788 2788
2789 switch (event) { 2789 switch (event) {
2790 case NETDEV_DOWN: 2790 case NETDEV_DOWN: