mirror of
https://github.com/torvalds/linux.git
synced 2026-04-30 12:32:31 -04:00
Instead of simply using EXPORT_SYMBOL() to export the functions needed in xe.ko to be be called across modules, use EXPORT_SYMBOL_IF_KUNIT() which will export the symbol under the EXPORTED_FOR_KUNIT_TESTING namespace. This avoids accidentally "leaking" these functions and letting them be called from outside the kunit tests. If these functiosn are accidentally called from another module, they receive a modpost error like below: ERROR: modpost: module XXXXXXX uses symbol xe_ccs_migrate_kunit from namespace EXPORTED_FOR_KUNIT_TESTING, but does not import it. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org> Link: https://lore.kernel.org/r/20230401085151.1786204-4-lucas.demarchi@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
26 lines
490 B
C
26 lines
490 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* Copyright © 2022 Intel Corporation
|
|
*/
|
|
|
|
#include "xe_bo_test.h"
|
|
|
|
#include <kunit/test.h>
|
|
|
|
static struct kunit_case xe_bo_tests[] = {
|
|
KUNIT_CASE(xe_ccs_migrate_kunit),
|
|
KUNIT_CASE(xe_bo_evict_kunit),
|
|
{}
|
|
};
|
|
|
|
static struct kunit_suite xe_bo_test_suite = {
|
|
.name = "xe_bo",
|
|
.test_cases = xe_bo_tests,
|
|
};
|
|
|
|
kunit_test_suite(xe_bo_test_suite);
|
|
|
|
MODULE_AUTHOR("Intel Corporation");
|
|
MODULE_LICENSE("GPL");
|
|
MODULE_IMPORT_NS(EXPORTED_FOR_KUNIT_TESTING);
|