Re: [PATCH 02/24] drm/tests: helpers: Remove the name parameter

Javier Martinez Canillas
2022-11-25T08:58:31Z

> The device name isn't really useful, we can just define it instead of
> exposing it in the API.
>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---
> drivers/gpu/drm/tests/drm_client_modeset_test.c | 2 +-
> drivers/gpu/drm/tests/drm_kunit_helpers.c | 6 ++++--
> drivers/gpu/drm/tests/drm_kunit_helpers.h | 3 +--
> 3 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/tests/drm_client_modeset_test.c b/drivers/gpu/drm/tests/drm_client_modeset_test.c
> index e469d1634e2d..6920c3ffdfdf 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_helper_alloc_drm_device(test, DRIVER_MODESET, "drm-client-modeset-test");
> + priv->drm = drm_kunit_helper_alloc_drm_device(test, DRIVER_MODESET);
> 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 a4ad030ed101..7f69f56f5892 100644
> --- a/drivers/gpu/drm/tests/drm_kunit_helpers.c
> +++ b/drivers/gpu/drm/tests/drm_kunit_helpers.c
> @@ -9,6 +9,8 @@
>
> #include "drm_kunit_helpers.h"
>
> +#define FAKE_DEVICE_NAME "drm-kunit-fake-device"
> +

I think that KUNIT_DEVICE_NAME and "drm-kunit-mock-device" are more descriptive
names here. But I'm also OK with the patch as is.