lib: Make test_sysctl initialized as module
authorMasami Hiramatsu <mhiramat@kernel.org>
Thu, 28 May 2020 14:52:16 +0000 (23:52 +0900)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 2 Jun 2020 16:26:14 +0000 (10:26 -0600)
test_sysctl.c is expected to be used as a module, but since
it does not use module_init(), it never be registered as
a module and not appeared under /sys/module/.
In the result, the selftests/sysctl/sysctl.sh always fails
to find the test module and is skipped.

This makes test_sysctl.c initialized as a module by module_init()
and allow sysctl.sh to find the test module is loaded.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
lib/test_sysctl.c

index 566dad3f419601165bc32e71f2f2a580afbc3c8c..ec4d0f03475d74a4f0a1679ca447a1b9069f461d 100644 (file)
@@ -149,7 +149,7 @@ static int __init test_sysctl_init(void)
        }
        return 0;
 }
-late_initcall(test_sysctl_init);
+module_init(test_sysctl_init);
 
 static void __exit test_sysctl_exit(void)
 {