Skip to contentSkip to conversation

platform/x86/intel/pmt: fix build dependency for kunit test

PATCH In review Arnd Bergmann 2 participants 2 messages Jul 14, 2025 – Jul 21, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86/intel/pmt: fix build dependency for kunit test

From: Arnd Bergmann <[email protected]>

When INTEL_PMT_TELEMETRY is in a loadable module, the discovery test cannot be built-in:

x86_64-linux-ld: drivers/platform/x86/intel/pmt/discovery-kunit.o: in function `test_intel_pmt_get_regions_by_feature':
discovery-kunit.c:(.text+0x29d): undefined reference to `intel_pmt_get_regions_by_feature'
x86_64-linux-ld: discovery-kunit.c:(.text+0x2c3): undefined reference to `intel_pmt_put_feature_group'

Add a Kconfig dependency to prevent this.

Fixes b9707d46a959 ("platform/x86/intel/pmt: KUNIT test for PMT Enhanced Discovery API")

---
A simpler 'depends on INTEL_PMT_TELEMETRY' would work just as well here, not sure what the more logical variant is between the two.

---
 drivers/platform/x86/intel/pmt/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/platform/x86/intel/pmt/Kconfig +1 -0
index 785c206e1beb..7363446b7773 100644
@@ -55,6 +55,7 @@ config INTEL_PMT_DISCOVERY
 config INTEL_PMT_KUNIT_TEST
 	tristate "KUnit tests for Intel PMT driver"
 	depends on INTEL_PMT_DISCOVERY
+	depends on INTEL_PMT_TELEMETRY || !INTEL_PMT_TELEMETRY
 	depends on KUNIT
 	help
 	  Enable this option to compile and run a suite of KUnit tests for the Intel
Signature · 1 line
2.39.5
maintainer
#1 lore raw
Quoted 8 lines · Arnd Bergmann

When INTEL_PMT_TELEMETRY is in a loadable module, the discovery test cannot be built-in:

x86_64-linux-ld: drivers/platform/x86/intel/pmt/discovery-kunit.o: in function `test_intel_pmt_get_regions_by_feature':
discovery-kunit.c:(.text+0x29d): undefined reference to `intel_pmt_get_regions_by_feature'
x86_64-linux-ld: discovery-kunit.c:(.text+0x2c3): undefined reference to `intel_pmt_put_feature_group'

[...]

Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86/intel/pmt: fix build dependency for kunit test

      commit: 5a9fffd8a533bfb2688ec69dd6d1b6e53ef1177a

--
i.