From: Paul Gortmaker Date: Sat, 2 May 2015 01:57:34 +0000 (-0400) Subject: lib/list_sort: use late_initcall to hook in self tests X-Git-Tag: v4.2-rc1~40^2~3 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=4c7217f1f0fe70af7b9e213ef16f1d2f4a4bacaf;p=linux-2.6-block.git lib/list_sort: use late_initcall to hook in self tests This was using module_init, but there is no way this code can be modular. In the non-modular case, a module_init becomes a device_initcall, but this really isn't a device. So we should choose a more appropriate initcall bucket to put it in. Assuming boot time self tests need to be observed over a console to be useful, and that the console device could possibly not be fully functional until after device_initcall, we move this to the late_initcall bucket, which is immediately after device_initcall. Cc: Andrew Morton Signed-off-by: Paul Gortmaker --- diff --git a/lib/list_sort.c b/lib/list_sort.c index b29015102698..3fe401067e20 100644 --- a/lib/list_sort.c +++ b/lib/list_sort.c @@ -289,5 +289,5 @@ exit: kfree(elts); return err; } -module_init(list_sort_test); +late_initcall(list_sort_test); #endif /* CONFIG_TEST_LIST_SORT */