ipv4: af_inet: make it explicitly non-modular
Subsystems (2)
PATCH 1/1 ipv4: af_inet: make it explicitly non-modular
The Makefile controlling compilation of this file is obj-y, meaning that it currently is never being built as a module.
Since MODULE_ALIAS is a no-op for non-modular code, we can simply remove the MODULE_ALIAS_NETPROTO variant used here.
We replace module.h with kmod.h since the file does make use of request_module() in order to load other modules from here.
We don't have to worry about init.h coming in via the removed module.h since the file explicitly includes init.h already.
--- net/ipv4/af_inet.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
net/ipv4/af_inet.c +1 -4
@@ -73,7 +73,7 @@#include <linux/socket.h> #include <linux/in.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/kmod.h> #include <linux/sched.h> #include <linux/timer.h> #include <linux/string.h>
@@ -1916,6 +1916,3 @@ static int __init ipv4_proc_init(void) return 0; }#endif /* CONFIG_PROC_FS */ - -MODULE_ALIAS_NETPROTO (PF_INET ); -
Signature · 1 line
2.8.4
From: Paul Gortmaker <[email protected]>
Date: Mon, 11 Jul 2016 16:37:51 -0400
Quoted 12 lines
The
Makefilecontrolling compilation of this file is obj-y, meaning that it currently is never being built as a module.Since
MODULE_ALIASis a no-op for non-modular code, we can simply remove theMODULE_ALIAS_NETPROTOvariant used here.We replace
module.hwithkmod.hsince the file does make use ofrequest_module()in order to load other modules from here.We don't have to worry about
init.hcoming in via the removedmodule.hsince the file explicitly includesinit.halready.
Quoted 7 lines
Cc "David S. Miller" <[email protected]>Cc Alexey Kuznetsov <[email protected]>Cc James Morris <[email protected]>Cc Hideaki YOSHIFUJI <[email protected]>Cc Patrick McHardy <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
Applied to net-next, thanks.