mirror of
https://github.com/torvalds/linux.git
synced 2026-04-28 19:42:31 -04:00
drm/xe/kunit: Simplify xe_mocs live tests code layout
The test case logic is implemented by the functions compiled as part of the core Xe driver module and then exported to build and register the test suite in the live test module. But we don't need to export individual test case functions, we may just export the entire test suite. And we don't need to register this test suite in a separate file, it can be done in the main file of the live test module. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240708111210.1154-5-michal.wajdeczko@intel.com
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
#include <kunit/test.h>
|
||||
#include <kunit/visibility.h>
|
||||
|
||||
#include "tests/xe_mocs_test.h"
|
||||
#include "tests/xe_pci_test.h"
|
||||
#include "tests/xe_test.h"
|
||||
|
||||
@@ -134,11 +133,10 @@ static int mocs_kernel_test_run_device(struct xe_device *xe)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void xe_live_mocs_kernel_kunit(struct kunit *test)
|
||||
static void xe_live_mocs_kernel_kunit(struct kunit *test)
|
||||
{
|
||||
xe_call_for_each_device(mocs_kernel_test_run_device);
|
||||
}
|
||||
EXPORT_SYMBOL_IF_KUNIT(xe_live_mocs_kernel_kunit);
|
||||
|
||||
static int mocs_reset_test_run_device(struct xe_device *xe)
|
||||
{
|
||||
@@ -175,8 +173,20 @@ static int mocs_reset_test_run_device(struct xe_device *xe)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void xe_live_mocs_reset_kunit(struct kunit *test)
|
||||
static void xe_live_mocs_reset_kunit(struct kunit *test)
|
||||
{
|
||||
xe_call_for_each_device(mocs_reset_test_run_device);
|
||||
}
|
||||
EXPORT_SYMBOL_IF_KUNIT(xe_live_mocs_reset_kunit);
|
||||
|
||||
static struct kunit_case xe_mocs_tests[] = {
|
||||
KUNIT_CASE(xe_live_mocs_kernel_kunit),
|
||||
KUNIT_CASE(xe_live_mocs_reset_kunit),
|
||||
{}
|
||||
};
|
||||
|
||||
VISIBLE_IF_KUNIT
|
||||
struct kunit_suite xe_mocs_test_suite = {
|
||||
.name = "xe_mocs",
|
||||
.test_cases = xe_mocs_tests,
|
||||
};
|
||||
EXPORT_SYMBOL_IF_KUNIT(xe_mocs_test_suite);
|
||||
|
||||
Reference in New Issue
Block a user