linux/drivers/gpu/drm/scheduler
Tvrtko Ursulin f412fe573b drm/sched: Fix clang build warning in kunit tests
Initializing compile time constant struct or arrays from another such
variable is a gcc extension, while clang strictly requires a compile time
constant literal.

As reported by LKP:

>> drivers/gpu/drm/scheduler/tests/tests_scheduler.c:675:10: error: initializer element is not a compile-time constant
                                 drm_sched_scheduler_two_clients_attr),
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:224:13: note: expanded from macro 'KUNIT_CASE_PARAM_ATTR'
                     .attr = attributes, .module_name = KBUILD_MODNAME}
                             ^~~~~~~~~~
   1 error generated.

vim +675 drivers/gpu/drm/scheduler/tests/tests_scheduler.c

   671
   672	static struct kunit_case drm_sched_scheduler_two_clients_tests[] = {
   673		KUNIT_CASE_PARAM_ATTR(drm_sched_scheduler_two_clients_test,
   674				      drm_sched_scheduler_two_clients_gen_params,
 > 675				      drm_sched_scheduler_two_clients_attr),
   676		{}
   677	};
   678

Fix it by using a compound literal as other tests do.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202605220312.Pu7UO05u-lkp@intel.com/
Fixes: 97ef806a53 ("drm/sched: Add some scheduling quality unit tests")
Cc: Philipp Stanner <phasta@kernel.org>
Acked-by: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
Link: https://lore.kernel.org/r/20260522090129.9385-1-tvrtko.ursulin@igalia.com
2026-05-29 10:37:12 +01:00
..
tests drm/sched: Fix clang build warning in kunit tests 2026-05-29 10:37:12 +01:00
.kunitconfig drm/sched: Add scheduler unit testing infrastructure and some basic tests 2025-03-24 10:41:52 +01:00
gpu_scheduler_trace.h drm/doc: Document some tracepoints as uAPI 2025-05-28 16:16:18 +02:00
Makefile drm/sched: Move run queue related code into a separate file 2026-04-17 14:43:28 +02:00
sched_entity.c drm/sched: Embed run queue singleton into the scheduler 2026-04-17 14:43:29 +02:00
sched_fence.c drm/sched: Embed run queue singleton into the scheduler 2026-04-17 14:43:29 +02:00
sched_internal.h drm/sched: Embed run queue singleton into the scheduler 2026-04-17 14:43:29 +02:00
sched_main.c drm/sched: Embed run queue singleton into the scheduler 2026-04-17 14:43:29 +02:00
sched_rq.c drm/sched: Embed run queue singleton into the scheduler 2026-04-17 14:43:29 +02:00