net: netdev_kobject_init: annotate with __init
authorDaniel Borkmann <dborkman@redhat.com>
Mon, 6 Jan 2014 00:20:11 +0000 (01:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Jan 2014 01:27:54 +0000 (20:27 -0500)
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: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/net-sysfs.c
net/core/net-sysfs.h

index 1a7b7b1df0d197febe3fecadca653dbe6d2c8a5b..49843bf7e43e43986cbdf86d466cad8c3fbb4914 100644 (file)
@@ -1358,7 +1358,7 @@ void netdev_class_remove_file_ns(struct class_attribute *class_attr,
 }
 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);
        return class_register(&net_class);
index bd7751ec1c4d63d50163438958480a7261a234e7..2745a1b51e034a808ae586e29890e686f7ce7833 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __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 *);
 void netdev_unregister_kobject(struct net_device *);
 int net_rx_queue_update_kobjects(struct net_device *, int old_num, int new_num);