diff options
| author | stephen hemminger <stephen@networkplumber.org> | 2013-12-29 17:01:29 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-01-01 23:46:09 -0500 |
| commit | 1d143d9f0c833fcf38cc737eb0a8698fa2dd144c (patch) | |
| tree | bb777ea9004c6828671f7ef284006bfeffcdc6a8 | |
| parent | 2173f8d953e76026bf6ede8ec81ad35ec158dae9 (diff) | |
net: core functions cleanup
The following functions are not used outside of net/core/dev.c
and should be declared static.
call_netdevice_notifiers_info
__dev_remove_offload
netdev_has_any_upper_dev
__netdev_adjacent_dev_remove
__netdev_adjacent_dev_link_lists
__netdev_adjacent_dev_unlink_lists
__netdev_adjacent_dev_unlink
__netdev_adjacent_dev_link_neighbour
__netdev_adjacent_dev_unlink_neighbour
And the following are never used and should be deleted
netdev_lower_dev_get_private_rcu
__netdev_find_adj_rcu
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | include/linux/netdevice.h | 6 | ||||
| -rw-r--r-- | net/core/dev.c | 82 |
2 files changed, 26 insertions, 62 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 88afa8048a7c..bec60c481966 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -1741,8 +1741,6 @@ netdev_notifier_info_to_dev(const struct netdev_notifier_info *info) | |||
| 1741 | return info->dev; | 1741 | return info->dev; |
| 1742 | } | 1742 | } |
| 1743 | 1743 | ||
| 1744 | int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev, | ||
| 1745 | struct netdev_notifier_info *info); | ||
| 1746 | int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | 1744 | int call_netdevice_notifiers(unsigned long val, struct net_device *dev); |
| 1747 | 1745 | ||
| 1748 | 1746 | ||
| @@ -1809,7 +1807,6 @@ void dev_remove_pack(struct packet_type *pt); | |||
| 1809 | void __dev_remove_pack(struct packet_type *pt); | 1807 | void __dev_remove_pack(struct packet_type *pt); |
| 1810 | void dev_add_offload(struct packet_offload *po); | 1808 | void dev_add_offload(struct packet_offload *po); |
| 1811 | void dev_remove_offload(struct packet_offload *po); | 1809 | void dev_remove_offload(struct packet_offload *po); |
| 1812 | void __dev_remove_offload(struct packet_offload *po); | ||
| 1813 | 1810 | ||
| 1814 | struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, | 1811 | struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, |
| 1815 | unsigned short mask); | 1812 | unsigned short mask); |
| @@ -2867,7 +2864,6 @@ extern int weight_p; | |||
| 2867 | extern int bpf_jit_enable; | 2864 | extern int bpf_jit_enable; |
| 2868 | 2865 | ||
| 2869 | bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev); | 2866 | bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev); |
| 2870 | bool netdev_has_any_upper_dev(struct net_device *dev); | ||
| 2871 | struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev, | 2867 | struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev, |
| 2872 | struct list_head **iter); | 2868 | struct list_head **iter); |
| 2873 | 2869 | ||
| @@ -2907,8 +2903,6 @@ int netdev_master_upper_dev_link_private(struct net_device *dev, | |||
| 2907 | void *private); | 2903 | void *private); |
| 2908 | void netdev_upper_dev_unlink(struct net_device *dev, | 2904 | void netdev_upper_dev_unlink(struct net_device *dev, |
| 2909 | struct net_device *upper_dev); | 2905 | struct net_device *upper_dev); |
| 2910 | void *netdev_lower_dev_get_private_rcu(struct net_device *dev, | ||
| 2911 | struct net_device *lower_dev); | ||
| 2912 | void *netdev_lower_dev_get_private(struct net_device *dev, | 2906 | void *netdev_lower_dev_get_private(struct net_device *dev, |
| 2913 | struct net_device *lower_dev); | 2907 | struct net_device *lower_dev); |
| 2914 | int skb_checksum_help(struct sk_buff *skb); | 2908 | int skb_checksum_help(struct sk_buff *skb); |
diff --git a/net/core/dev.c b/net/core/dev.c index cc9ab80581d7..77f43aa373fe 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -480,7 +480,7 @@ EXPORT_SYMBOL(dev_add_offload); | |||
| 480 | * and must not be freed until after all the CPU's have gone | 480 | * and must not be freed until after all the CPU's have gone |
| 481 | * through a quiescent state. | 481 | * through a quiescent state. |
| 482 | */ | 482 | */ |
| 483 | void __dev_remove_offload(struct packet_offload *po) | 483 | static void __dev_remove_offload(struct packet_offload *po) |
| 484 | { | 484 | { |
| 485 | struct list_head *head = &offload_base; | 485 | struct list_head *head = &offload_base; |
| 486 | struct packet_offload *po1; | 486 | struct packet_offload *po1; |
| @@ -498,7 +498,6 @@ void __dev_remove_offload(struct packet_offload *po) | |||
| 498 | out: | 498 | out: |
| 499 | spin_unlock(&offload_lock); | 499 | spin_unlock(&offload_lock); |
| 500 | } | 500 | } |
| 501 | EXPORT_SYMBOL(__dev_remove_offload); | ||
| 502 | 501 | ||
| 503 | /** | 502 | /** |
| 504 | * dev_remove_offload - remove packet offload handler | 503 | * dev_remove_offload - remove packet offload handler |
| @@ -1566,14 +1565,14 @@ EXPORT_SYMBOL(unregister_netdevice_notifier); | |||
| 1566 | * are as for raw_notifier_call_chain(). | 1565 | * are as for raw_notifier_call_chain(). |
| 1567 | */ | 1566 | */ |
| 1568 | 1567 | ||
| 1569 | int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev, | 1568 | static int call_netdevice_notifiers_info(unsigned long val, |
| 1570 | struct netdev_notifier_info *info) | 1569 | struct net_device *dev, |
| 1570 | struct netdev_notifier_info *info) | ||
| 1571 | { | 1571 | { |
| 1572 | ASSERT_RTNL(); | 1572 | ASSERT_RTNL(); |
| 1573 | netdev_notifier_info_init(info, dev); | 1573 | netdev_notifier_info_init(info, dev); |
| 1574 | return raw_notifier_call_chain(&netdev_chain, val, info); | 1574 | return raw_notifier_call_chain(&netdev_chain, val, info); |
| 1575 | } | 1575 | } |
| 1576 | EXPORT_SYMBOL(call_netdevice_notifiers_info); | ||
| 1577 | 1576 | ||
| 1578 | /** | 1577 | /** |
| 1579 | * call_netdevice_notifiers - call all network notifier blocks | 1578 | * call_netdevice_notifiers - call all network notifier blocks |
| @@ -4355,19 +4354,6 @@ struct netdev_adjacent { | |||
| 4355 | struct rcu_head rcu; | 4354 | struct rcu_head rcu; |
| 4356 | }; | 4355 | }; |
| 4357 | 4356 | ||
| 4358 | static struct netdev_adjacent *__netdev_find_adj_rcu(struct net_device *dev, | ||
| 4359 | struct net_device *adj_dev, | ||
| 4360 | struct list_head *adj_list) | ||
| 4361 | { | ||
| 4362 | struct netdev_adjacent *adj; | ||
| 4363 | |||
| 4364 | list_for_each_entry_rcu(adj, adj_list, list) { | ||
| 4365 | if (adj->dev == adj_dev) | ||
| 4366 | return adj; | ||
| 4367 | } | ||
| 4368 | return NULL; | ||
| 4369 | } | ||
| 4370 | |||
| 4371 | static struct netdev_adjacent *__netdev_find_adj(struct net_device *dev, | 4357 | static struct netdev_adjacent *__netdev_find_adj(struct net_device *dev, |
| 4372 | struct net_device *adj_dev, | 4358 | struct net_device *adj_dev, |
| 4373 | struct list_head *adj_list) | 4359 | struct list_head *adj_list) |
| @@ -4406,13 +4392,12 @@ EXPORT_SYMBOL(netdev_has_upper_dev); | |||
| 4406 | * Find out if a device is linked to an upper device and return true in case | 4392 | * Find out if a device is linked to an upper device and return true in case |
| 4407 | * it is. The caller must hold the RTNL lock. | 4393 | * it is. The caller must hold the RTNL lock. |
| 4408 | */ | 4394 | */ |
| 4409 | bool netdev_has_any_upper_dev(struct net_device *dev) | 4395 | static bool netdev_has_any_upper_dev(struct net_device *dev) |
| 4410 | { | 4396 | { |
| 4411 | ASSERT_RTNL(); | 4397 | ASSERT_RTNL(); |
| 4412 | 4398 | ||
| 4413 | return !list_empty(&dev->all_adj_list.upper); | 4399 | return !list_empty(&dev->all_adj_list.upper); |
| 4414 | } | 4400 | } |
| 4415 | EXPORT_SYMBOL(netdev_has_any_upper_dev); | ||
| 4416 | 4401 | ||
| 4417 | /** | 4402 | /** |
| 4418 | * netdev_master_upper_dev_get - Get master upper device | 4403 | * netdev_master_upper_dev_get - Get master upper device |
| @@ -4644,9 +4629,9 @@ free_adj: | |||
| 4644 | return ret; | 4629 | return ret; |
| 4645 | } | 4630 | } |
| 4646 | 4631 | ||
| 4647 | void __netdev_adjacent_dev_remove(struct net_device *dev, | 4632 | static void __netdev_adjacent_dev_remove(struct net_device *dev, |
| 4648 | struct net_device *adj_dev, | 4633 | struct net_device *adj_dev, |
| 4649 | struct list_head *dev_list) | 4634 | struct list_head *dev_list) |
| 4650 | { | 4635 | { |
| 4651 | struct netdev_adjacent *adj; | 4636 | struct netdev_adjacent *adj; |
| 4652 | char linkname[IFNAMSIZ+7]; | 4637 | char linkname[IFNAMSIZ+7]; |
| @@ -4684,11 +4669,11 @@ void __netdev_adjacent_dev_remove(struct net_device *dev, | |||
| 4684 | kfree_rcu(adj, rcu); | 4669 | kfree_rcu(adj, rcu); |
| 4685 | } | 4670 | } |
| 4686 | 4671 | ||
| 4687 | int __netdev_adjacent_dev_link_lists(struct net_device *dev, | 4672 | static int __netdev_adjacent_dev_link_lists(struct net_device *dev, |
| 4688 | struct net_device *upper_dev, | 4673 | struct net_device *upper_dev, |
| 4689 | struct list_head *up_list, | 4674 | struct list_head *up_list, |
| 4690 | struct list_head *down_list, | 4675 | struct list_head *down_list, |
| 4691 | void *private, bool master) | 4676 | void *private, bool master) |
| 4692 | { | 4677 | { |
| 4693 | int ret; | 4678 | int ret; |
| 4694 | 4679 | ||
| @@ -4707,8 +4692,8 @@ int __netdev_adjacent_dev_link_lists(struct net_device *dev, | |||
| 4707 | return 0; | 4692 | return 0; |
| 4708 | } | 4693 | } |
| 4709 | 4694 | ||
| 4710 | int __netdev_adjacent_dev_link(struct net_device *dev, | 4695 | static int __netdev_adjacent_dev_link(struct net_device *dev, |
| 4711 | struct net_device *upper_dev) | 4696 | struct net_device *upper_dev) |
| 4712 | { | 4697 | { |
| 4713 | return __netdev_adjacent_dev_link_lists(dev, upper_dev, | 4698 | return __netdev_adjacent_dev_link_lists(dev, upper_dev, |
| 4714 | &dev->all_adj_list.upper, | 4699 | &dev->all_adj_list.upper, |
| @@ -4716,26 +4701,26 @@ int __netdev_adjacent_dev_link(struct net_device *dev, | |||
| 4716 | NULL, false); | 4701 | NULL, false); |
| 4717 | } | 4702 | } |
| 4718 | 4703 | ||
| 4719 | void __netdev_adjacent_dev_unlink_lists(struct net_device *dev, | 4704 | static void __netdev_adjacent_dev_unlink_lists(struct net_device *dev, |
| 4720 | struct net_device *upper_dev, | 4705 | struct net_device *upper_dev, |
| 4721 | struct list_head *up_list, | 4706 | struct list_head *up_list, |
| 4722 | struct list_head *down_list) | 4707 | struct list_head *down_list) |
| 4723 | { | 4708 | { |
| 4724 | __netdev_adjacent_dev_remove(dev, upper_dev, up_list); | 4709 | __netdev_adjacent_dev_remove(dev, upper_dev, up_list); |
| 4725 | __netdev_adjacent_dev_remove(upper_dev, dev, down_list); | 4710 | __netdev_adjacent_dev_remove(upper_dev, dev, down_list); |
| 4726 | } | 4711 | } |
| 4727 | 4712 | ||
| 4728 | void __netdev_adjacent_dev_unlink(struct net_device *dev, | 4713 | static void __netdev_adjacent_dev_unlink(struct net_device *dev, |
| 4729 | struct net_device *upper_dev) | 4714 | struct net_device *upper_dev) |
| 4730 | { | 4715 | { |
| 4731 | __netdev_adjacent_dev_unlink_lists(dev, upper_dev, | 4716 | __netdev_adjacent_dev_unlink_lists(dev, upper_dev, |
| 4732 | &dev->all_adj_list.upper, | 4717 | &dev->all_adj_list.upper, |
| 4733 | &upper_dev->all_adj_list.lower); | 4718 | &upper_dev->all_adj_list.lower); |
| 4734 | } | 4719 | } |
| 4735 | 4720 | ||
| 4736 | int __netdev_adjacent_dev_link_neighbour(struct net_device *dev, | 4721 | static int __netdev_adjacent_dev_link_neighbour(struct net_device *dev, |
| 4737 | struct net_device *upper_dev, | 4722 | struct net_device *upper_dev, |
| 4738 | void *private, bool master) | 4723 | void *private, bool master) |
| 4739 | { | 4724 | { |
| 4740 | int ret = __netdev_adjacent_dev_link(dev, upper_dev); | 4725 | int ret = __netdev_adjacent_dev_link(dev, upper_dev); |
| 4741 | 4726 | ||
| @@ -4754,8 +4739,8 @@ int __netdev_adjacent_dev_link_neighbour(struct net_device *dev, | |||
| 4754 | return 0; | 4739 | return 0; |
| 4755 | } | 4740 | } |
| 4756 | 4741 | ||
| 4757 | void __netdev_adjacent_dev_unlink_neighbour(struct net_device *dev, | 4742 | static void __netdev_adjacent_dev_unlink_neighbour(struct net_device *dev, |
| 4758 | struct net_device *upper_dev) | 4743 | struct net_device *upper_dev) |
| 4759 | { | 4744 | { |
| 4760 | __netdev_adjacent_dev_unlink(dev, upper_dev); | 4745 | __netdev_adjacent_dev_unlink(dev, upper_dev); |
| 4761 | __netdev_adjacent_dev_unlink_lists(dev, upper_dev, | 4746 | __netdev_adjacent_dev_unlink_lists(dev, upper_dev, |
| @@ -4944,21 +4929,6 @@ void netdev_upper_dev_unlink(struct net_device *dev, | |||
| 4944 | } | 4929 | } |
| 4945 | EXPORT_SYMBOL(netdev_upper_dev_unlink); | 4930 | EXPORT_SYMBOL(netdev_upper_dev_unlink); |
| 4946 | 4931 | ||
| 4947 | void *netdev_lower_dev_get_private_rcu(struct net_device *dev, | ||
| 4948 | struct net_device *lower_dev) | ||
| 4949 | { | ||
| 4950 | struct netdev_adjacent *lower; | ||
| 4951 | |||
| 4952 | if (!lower_dev) | ||
| 4953 | return NULL; | ||
| 4954 | lower = __netdev_find_adj_rcu(dev, lower_dev, &dev->adj_list.lower); | ||
| 4955 | if (!lower) | ||
| 4956 | return NULL; | ||
| 4957 | |||
| 4958 | return lower->private; | ||
| 4959 | } | ||
| 4960 | EXPORT_SYMBOL(netdev_lower_dev_get_private_rcu); | ||
| 4961 | |||
| 4962 | void *netdev_lower_dev_get_private(struct net_device *dev, | 4932 | void *netdev_lower_dev_get_private(struct net_device *dev, |
| 4963 | struct net_device *lower_dev) | 4933 | struct net_device *lower_dev) |
| 4964 | { | 4934 | { |
