Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Daniel Borkmann and committed by
David S. Miller
a48d4bb0 855404ef

+2 -2
+1 -1
net/core/net-sysfs.c
··· 1358 1358 } 1359 1359 EXPORT_SYMBOL(netdev_class_remove_file_ns); 1360 1360 1361 - int netdev_kobject_init(void) 1361 + int __init netdev_kobject_init(void) 1362 1362 { 1363 1363 kobj_ns_type_register(&net_ns_type_operations); 1364 1364 return class_register(&net_class);
+1 -1
net/core/net-sysfs.h
··· 1 1 #ifndef __NET_SYSFS_H__ 2 2 #define __NET_SYSFS_H__ 3 3 4 - int netdev_kobject_init(void); 4 + int __init netdev_kobject_init(void); 5 5 int netdev_register_kobject(struct net_device *); 6 6 void netdev_unregister_kobject(struct net_device *); 7 7 int net_rx_queue_update_kobjects(struct net_device *, int old_num, int new_num);