Re: [PATCH 01/24] drm/tests: helpers: Rename the device init helper

Maíra Canal
2022-11-25T14:10:20Z

On 11/23/22 12:25, Maxime Ripard wrote:
> The name doesn't really fit the conventions for the other helpers in
> DRM/KMS, so let's rename it to make it obvious that we allocate a new
> DRM device.
>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>

Although I believe using "drm_device" on the function name is a bit
redundant (maybe drm_kunit_helper_alloc_dev or
drm_kunit_helper_alloc_device would be cleaner),

Reviewed-by: Maíra Canal <mairacanal@riseup.net>

Best Regards,
- Maíra Canal

> ---
> drivers/gpu/drm/tests/drm_client_modeset_test.c | 2 +-
> drivers/gpu/drm/tests/drm_kunit_helpers.c | 4 +++-
> drivers/gpu/drm/tests/drm_kunit_helpers.h | 5 ++++-
> 3 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/tests/drm_client_modeset_test.c b/drivers/gpu/drm/tests/drm_client_modeset_test.c
> index 362a5fbd82f5..e469d1634e2d 100644
> --- a/drivers/gpu/drm/tests/drm_client_modeset_test.c
> +++ b/drivers/gpu/drm/tests/drm_client_modeset_test.c
> @@ -41,7 +41,7 @@ static int drm_client_modeset_test_init(struct kunit *test)
>
> test->priv = priv;
>
> - priv->drm = drm_kunit_device_init(test, DRIVER_MODESET, "drm-client-modeset-test");
> + priv->drm = drm_kunit_helper_alloc_drm_device(test, DRIVER_MODESET, "drm-client-modeset-test");
> KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv->drm);
>
> ret = drmm_connector_init(priv->drm, &priv->connector,
> diff --git a/drivers/gpu/drm/tests/drm_kunit_helpers.c b/drivers/gpu/drm/tests/drm_kunit_helpers.c
> index f1662091f250..a4ad030ed101 100644
> --- a/drivers/gpu/drm/tests/drm_kunit_helpers.c
> +++ b/drivers/gpu/drm/tests/drm_kunit_helpers.c
> @@ -36,7 +36,9 @@ static void dev_free(struct kunit_resource *res)
> root_device_unregister(dev);
> }
>
> -struct drm_device *drm_kunit_device_init(struct kunit *test, u32 features, char *name)
> +struct drm_device *
> +drm_kunit_helper_alloc_drm_device(struct kunit *test,
> + u32 features, char *name)
> {
> struct kunit_dev *kdev;
> struct drm_device *drm;
> diff --git a/drivers/gpu/drm/tests/drm_kunit_helpers.h b/drivers/gpu/drm/tests/drm_kunit_helpers.h
> index 20ab6eec4c89..e9870c7911fe 100644
> --- a/drivers/gpu/drm/tests/drm_kunit_helpers.h
> +++ b/drivers/gpu/drm/tests/drm_kunit_helpers.h
> @@ -6,6 +6,9 @@
> struct drm_device;
> struct kunit;
>
> -struct drm_device *drm_kunit_device_init(struct kunit *test, u32 features, char *name);
> +struct drm_device *
> +drm_kunit_helper_alloc_drm_device(struct kunit *test,
> + u32 features,
> + char *name);
>
> #endif // DRM_KUNIT_HELPERS_H_
>