// SPDX-License-Identifier: GPL-2.0 #include #include #include #include MODULE_LICENSE("GPL"); MODULE_AUTHOR("42"); MODULE_DESCRIPTION("A module that does work"); static int do_work(int *nb_loop) { int x; for (x = 0; x < *nb_loop; ++x) usleep_range(10); if (*nb_loop > 10) pr_info("%s: slept a long time\n", __func__); return(x * *nb_loop); } static int __init module_example_42_init(void) { int x = 10; x = do_work(&x); return x; } module_init(module_example_42_init);