[PATCH] Documentation: Kunit: add MODULE_LICENSE to sample code

Takashi Sakamoto posted 1 patch 2 years, 8 months ago
Documentation/dev-tools/kunit/start.rst | 2 ++
1 file changed, 2 insertions(+)
[PATCH] Documentation: Kunit: add MODULE_LICENSE to sample code
Posted by Takashi Sakamoto 2 years, 8 months ago
The sample code has Kconfig for tristate configuration. In the case, it
could be friendly to developers that the code has MODULE_LICENSE, since
the missing MODULE_LICENSE brings error to modpost when the code is built
as loadable kernel module.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 Documentation/dev-tools/kunit/start.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst
index c736613c9b19..d4f99ef94f71 100644
--- a/Documentation/dev-tools/kunit/start.rst
+++ b/Documentation/dev-tools/kunit/start.rst
@@ -250,6 +250,8 @@ Now we are ready to write the test cases.
 	};
 	kunit_test_suite(misc_example_test_suite);
 
+	MODULE_LICENSE("GPL");
+
 2. Add the following lines to ``drivers/misc/Kconfig``:
 
 .. code-block:: kconfig
-- 
2.39.2
Re: [PATCH] Documentation: Kunit: add MODULE_LICENSE to sample code
Posted by David Gow 2 years, 8 months ago
On Tue, 30 May 2023 at 18:52, Takashi Sakamoto <o-takashi@sakamocchi.jp> wrote:
>
> The sample code has Kconfig for tristate configuration. In the case, it
> could be friendly to developers that the code has MODULE_LICENSE, since
> the missing MODULE_LICENSE brings error to modpost when the code is built
> as loadable kernel module.
>
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> ---

Thanks!

Reviewed-by: David Gow <davidgow@google.com>

-- David


>  Documentation/dev-tools/kunit/start.rst | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst
> index c736613c9b19..d4f99ef94f71 100644
> --- a/Documentation/dev-tools/kunit/start.rst
> +++ b/Documentation/dev-tools/kunit/start.rst
> @@ -250,6 +250,8 @@ Now we are ready to write the test cases.
>         };
>         kunit_test_suite(misc_example_test_suite);
>
> +       MODULE_LICENSE("GPL");
> +
>  2. Add the following lines to ``drivers/misc/Kconfig``:
>
>  .. code-block:: kconfig
> --
> 2.39.2
>