[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABVgOSnAFM3HozugcOdmgEBja7Q5n1OYkV+ZJ+uFnCaWDTVneQ@mail.gmail.com>
Date: Wed, 18 Jan 2023 08:37:26 +0800
From: David Gow <davidgow@...gle.com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Brendan Higgins <brendan.higgins@...ux.dev>,
Arnd Bergmann <arnd@...db.de>,
Shuah Khan <skhan@...uxfoundation.org>,
Daniel Latypov <dlatypov@...gle.com>,
Jeremy Kerr <jk@...econstruct.com.au>,
Joe Fradley <joefradley@...gle.com>,
Maxime Ripard <maxime@...no.tech>,
Javier Martinez Canillas <javierm@...hat.com>,
MaĆra Canal <mcanal@...lia.com>,
linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kunit: Export kunit_running()
On Wed, 18 Jan 2023 at 00:50, Arnd Bergmann <arnd@...nel.org> wrote:
>
> From: Arnd Bergmann <arnd@...db.de>
>
> Using kunit_fail_current_test() in a loadable module causes a link
> error like:
>
> ERROR: modpost: "kunit_running" [drivers/gpu/drm/vc4/vc4.ko] undefined!
>
> Export the symbol to allow using it from modules.
>
> Fixes: da43ff045c3f ("drm/vc4: tests: Fail the current test if we access a register")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
Thanks for fixing this!
I think the longer-term solution for this is the "hooks" approach
(which works even when KUnit itself is built as a module):
https://lore.kernel.org/all/20230117142737.246446-1-davidgow@google.com/
But this looks good to fix it in the meantime.
Reviewed-by: David Gow <davidgow@...gle.com>
Cheers,
-- David
> lib/kunit/test.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/kunit/test.c b/lib/kunit/test.c
> index c9ebf975e56b..890ba5b3a981 100644
> --- a/lib/kunit/test.c
> +++ b/lib/kunit/test.c
> @@ -21,6 +21,7 @@
> #include "try-catch-impl.h"
>
> DEFINE_STATIC_KEY_FALSE(kunit_running);
> +EXPORT_SYMBOL_GPL(kunit_running);
>
> #if IS_BUILTIN(CONFIG_KUNIT)
> /*
> --
> 2.39.0
>
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4003 bytes)
Powered by blists - more mailing lists