On 29/05/2026 10:20, Philipp Stanner wrote:
On Fri, 2026-05-29 at 08:16 +0100, Tvrtko Ursulin wrote:
On 28/05/2026 14:38, Tvrtko Ursulin wrote:
On 28/05/2026 14:03, Philipp Stanner wrote:
Yo Tvrtko,
On Fri, 2026-05-22 at 10:01 +0100, Tvrtko Ursulin wrote:
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.
Hmm, is it now a build error, or a build warning? The commit title says
"warning".
Depending on what it really is, where should it go, misc-next or misc-
fixes?
Right, warning or error it depends if someone enabled CONFIG_DRM_WERROR.
According to drm-misc commiter guidelines, since we are in -rc5, it can
go to drm-misc-next.
Now it's drm-misc-next-fixes I think since Maarten sent the last
drm-misc-next pull request yesterday.
Acked-by: Philipp Stanner <[email protected]>
Feel free to do that as you see fit
Pushed to drm-misc-next-fixes, thank you!
Regards,
Tvrtko
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 <[email protected]>
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/202605220312.Pu7UO05u-
[email protected]/
Fixes: 97ef806a5314 ("drm/sched: Add some scheduling quality unit
tests")
Cc: Philipp Stanner <[email protected]>
---
drivers/gpu/drm/scheduler/tests/tests_scheduler.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/scheduler/tests/tests_scheduler.c b/
drivers/gpu/drm/scheduler/tests/tests_scheduler.c
index 8b2e4ef9915f..90d31888cf92 100644
--- a/drivers/gpu/drm/scheduler/tests/tests_scheduler.c
+++ b/drivers/gpu/drm/scheduler/tests/tests_scheduler.c
@@ -666,14 +666,10 @@ static void
drm_sched_scheduler_two_clients_test(struct kunit *test)
}
}
-static const struct kunit_attributes
drm_sched_scheduler_two_clients_attr = {
- .speed = KUNIT_SPEED_SLOW,
-};
-
static struct kunit_case drm_sched_scheduler_two_clients_tests[] = {
KUNIT_CASE_PARAM_ATTR(drm_sched_scheduler_two_clients_test,
drm_sched_scheduler_two_clients_gen_params,
- drm_sched_scheduler_two_clients_attr),
+ { .speed = KUNIT_SPEED_SLOW }),
{}
};
@@ -858,14 +854,10 @@ static void
drm_sched_scheduler_many_clients_test(struct kunit *test)
drm_mock_sched_entity_free(client[i].entity);
}
-static const struct kunit_attributes
drm_sched_scheduler_many_clients_attr = {
- .speed = KUNIT_SPEED_SLOW,
-};
-
static struct kunit_case drm_sched_scheduler_many_clients_tests[] = {
KUNIT_CASE_PARAM_ATTR(drm_sched_scheduler_many_clients_test,
drm_sched_scheduler_many_clients_gen_params,
- drm_sched_scheduler_many_clients_attr),
+ { .speed = KUNIT_SPEED_SLOW }),
{}
};