linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/vc4: allow DRM_VC4_KUNIT_TEST to be a loadable module
@ 2023-02-02 10:23 Arnd Bergmann
  2023-02-02 12:38 ` Maxime Ripard
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2023-02-02 10:23 UTC (permalink / raw)
  To: Emma Anholt, Maxime Ripard
  Cc: Arnd Bergmann, David Airlie, Daniel Vetter, Thomas Zimmermann,
	Sam Ravnborg, Javier Martinez Canillas, Zheng Bin,
	Danilo Krummrich, Maíra Canal, dri-devel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

In configurations with CONFIG_KUNIT=m, builting the unit test
into the kernel causes a link failure:

arm-linux-gnueabi-ld: drivers/gpu/drm/vc4/tests/vc4_mock.o: in function `__build_mock':
vc4_mock.c:(.text+0x6e): undefined reference to `kunit_do_failed_assertion'
arm-linux-gnueabi-ld: vc4_mock.c:(.text+0x9c): undefined reference to `kunit_do_failed_assertion'
arm-linux-gnueabi-ld: vc4_mock.c:(.text+0x100): undefined reference to `kunit_ptr_not_err_assert_format'
...

Allow this to be a loadable module as well to have Kconfig
sort out the dependencies correctly.

Fixes: f759f5b53f1c ("drm/vc4: tests: Introduce a mocking infrastructure")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/vc4/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig
index f423941c028d..91dcf8d174d6 100644
--- a/drivers/gpu/drm/vc4/Kconfig
+++ b/drivers/gpu/drm/vc4/Kconfig
@@ -36,7 +36,7 @@ config DRM_VC4_HDMI_CEC
 	  and want to use CEC.
 
 config DRM_VC4_KUNIT_TEST
-	bool "KUnit tests for VC4" if !KUNIT_ALL_TESTS
+	tristate "KUnit tests for VC4" if !KUNIT_ALL_TESTS
 	depends on DRM_VC4 && KUNIT
 	select DRM_KUNIT_TEST_HELPERS
 	default KUNIT_ALL_TESTS
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/vc4: allow DRM_VC4_KUNIT_TEST to be a loadable module
  2023-02-02 10:23 [PATCH] drm/vc4: allow DRM_VC4_KUNIT_TEST to be a loadable module Arnd Bergmann
@ 2023-02-02 12:38 ` Maxime Ripard
  0 siblings, 0 replies; 2+ messages in thread
From: Maxime Ripard @ 2023-02-02 12:38 UTC (permalink / raw)
  To: Emma Anholt, Maxime Ripard, Arnd Bergmann
  Cc: Arnd Bergmann, David Airlie, Daniel Vetter, Thomas Zimmermann,
	Sam Ravnborg, Javier Martinez Canillas, Zheng Bin,
	Danilo Krummrich, Maíra Canal, dri-devel, linux-kernel

On Thu, 02 Feb 2023 11:23:32 +0100, Arnd Bergmann wrote:
> In configurations with CONFIG_KUNIT=m, builting the unit test
> into the kernel causes a link failure:
> 
> arm-linux-gnueabi-ld: drivers/gpu/drm/vc4/tests/vc4_mock.o: in function `__build_mock':
> vc4_mock.c:(.text+0x6e): undefined reference to `kunit_do_failed_assertion'
> arm-linux-gnueabi-ld: vc4_mock.c:(.text+0x9c): undefined reference to `kunit_do_failed_assertion'
> arm-linux-gnueabi-ld: vc4_mock.c:(.text+0x100): undefined reference to `kunit_ptr_not_err_assert_format'
> ...
> 
> [...]

Applied to drm/drm-misc (drm-misc-next-fixes).

Thanks!
Maxime


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-02 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02 10:23 [PATCH] drm/vc4: allow DRM_VC4_KUNIT_TEST to be a loadable module Arnd Bergmann
2023-02-02 12:38 ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).