drm/xe: Use symbol namespace for kunit tests
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
parent
e5b101e7
No related branches found
No related tags found
Showing
- drivers/gpu/drm/xe/tests/xe_bo.c 3 additions, 2 deletionsdrivers/gpu/drm/xe/tests/xe_bo.c
- drivers/gpu/drm/xe/tests/xe_bo_test.c 1 addition, 0 deletionsdrivers/gpu/drm/xe/tests/xe_bo_test.c
- drivers/gpu/drm/xe/tests/xe_dma_buf.c 2 additions, 1 deletiondrivers/gpu/drm/xe/tests/xe_dma_buf.c
- drivers/gpu/drm/xe/tests/xe_dma_buf_test.c 1 addition, 0 deletionsdrivers/gpu/drm/xe/tests/xe_dma_buf_test.c
- drivers/gpu/drm/xe/tests/xe_migrate.c 2 additions, 1 deletiondrivers/gpu/drm/xe/tests/xe_migrate.c
- drivers/gpu/drm/xe/tests/xe_migrate_test.c 1 addition, 0 deletionsdrivers/gpu/drm/xe/tests/xe_migrate_test.c
Please register or sign in to comment