On Thu, 2026-09-03 at 20:15 +0800, [email protected] wrote:
> 

[…]

> +
>  #include "sched_tests.h"
>  
>  /*
> @@ -288,6 +290,7 @@ static const struct drm_sched_backend_ops 
> drm_mock_scheduler_ops = {
>   */
>  struct drm_mock_scheduler *drm_mock_sched_new(struct kunit *test, long 
> timeout)
>  {
> +     static unsigned int instance;

I know statics are initialized to 0 automatically, but writing it out
explicitly is probably advantageous for readability, especially since
we're incrementing.

>       struct drm_sched_init_args args = {
>               .ops            = &drm_mock_scheduler_ops,
>               .num_rqs        = DRM_SCHED_PRIORITY_COUNT,
> @@ -297,11 +300,19 @@ struct drm_mock_scheduler *drm_mock_sched_new(struct 
> kunit *test, long timeout)
>               .name           = "drm-mock-scheduler",
>       };
>       struct drm_mock_scheduler *sched;
> +     struct device *dev;
> +     char name[64];
>       int ret;
>  
>       sched = kunit_kzalloc(test, sizeof(*sched), GFP_KERNEL);
>       KUNIT_ASSERT_NOT_NULL(test, sched);
>  
> +     snprintf(name, sizeof(name), "%s-%u", args.name, ++instance);

Any particular reason why you begin with index 1?

Reply via email to