Re: [PATCH 1/3] Revert "lib/test_sort.c: make it explicitly non-modular"
From: Andy Shevchenko
Date: Tue Feb 28 2017 - 09:24:44 EST
On Tue, 2017-02-28 at 14:06 +0100, Geert Uytterhoeven wrote:
> This reverts commit 8893f519330bb073a49c5b4676fce4be6f1be15d.
>
> It's very valuable to have modular tests, so you can run them just by
> insmodding the test modules, instead of needing a separate kernel that
> runs them at boot.
>
> Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> ---
> Âlib/test_sort.c | 11 +++++------
> Â1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/lib/test_sort.c b/lib/test_sort.c
> index 4db3911db50ace76..d389c1cc2f6cf795 100644
> --- a/lib/test_sort.c
> +++ b/lib/test_sort.c
> @@ -1,11 +1,8 @@
> Â#include <linux/sort.h>
> Â#include <linux/slab.h>
> -#include <linux/init.h>
> +#include <linux/module.h>
>
> Â
> -/*
> - * A simple boot-time regression test
> - * License: GPL
> - */
> +/* a simple boot-time regression test */
I would leave this piece as is now.
The rest is okay.
> Â
> Â#define TEST_LEN 1000
> Â
> @@ -41,4 +38,6 @@ static int __init test_sort_init(void)
> Â kfree(a);
> Â return err;
> Â}
> -subsys_initcall(test_sort_init);
> +
> +module_init(test_sort_init);
> +MODULE_LICENSE("GPL");
--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy