Commit a48d4bb0 authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller

net: netdev_kobject_init: annotate with __init

netdev_kobject_init() is only being called from __init context,
that is, net_dev_init(), so annotate it with __init as well, thus
the kernel can take this as a hint that the function is used only
during the initialization phase and free up used memory resources
after its invocation.
Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 855404ef
...@@ -1358,7 +1358,7 @@ void netdev_class_remove_file_ns(struct class_attribute *class_attr, ...@@ -1358,7 +1358,7 @@ void netdev_class_remove_file_ns(struct class_attribute *class_attr,
} }
EXPORT_SYMBOL(netdev_class_remove_file_ns); EXPORT_SYMBOL(netdev_class_remove_file_ns);
int netdev_kobject_init(void) int __init netdev_kobject_init(void)
{ {
kobj_ns_type_register(&net_ns_type_operations); kobj_ns_type_register(&net_ns_type_operations);
return class_register(&net_class); return class_register(&net_class);
......
#ifndef __NET_SYSFS_H__ #ifndef __NET_SYSFS_H__
#define __NET_SYSFS_H__ #define __NET_SYSFS_H__
int netdev_kobject_init(void); int __init netdev_kobject_init(void);
int netdev_register_kobject(struct net_device *); int netdev_register_kobject(struct net_device *);
void netdev_unregister_kobject(struct net_device *); void netdev_unregister_kobject(struct net_device *);
int net_rx_queue_update_kobjects(struct net_device *, int old_num, int new_num); int net_rx_queue_update_kobjects(struct net_device *, int old_num, int new_num);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment