[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z5uDH033JbPvC1to@louis-chauvet-laptop>
Date: Thu, 30 Jan 2025 14:48:15 +0100
From: Louis Chauvet <louis.chauvet@...tlin.com>
To: José Expósito <jose.exposito89@...il.com>
Cc: hamohammed.sa@...il.com, simona@...ll.ch, melissa.srw@...il.com,
maarten.lankhorst@...ux.intel.com, mripard@...nel.org,
tzimmermann@...e.de, airlied@...il.com,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/13] drm/vkms: Set device name from vkms_config
On 29/01/25 - 12:00, José Expósito wrote:
> In order to be able to create multiple devices, the device name needs to
> be unique.
>
> Allow to set it in the VKMS configuration.
>
> Signed-off-by: José Expósito <jose.exposito89@...il.com>
[...]
> diff --git a/drivers/gpu/drm/vkms/tests/vkms_config_test.c b/drivers/gpu/drm/vkms/tests/vkms_config_test.c
> index d8644a1e3e18..526800b1afb4 100644
> --- a/drivers/gpu/drm/vkms/tests/vkms_config_test.c
> +++ b/drivers/gpu/drm/vkms/tests/vkms_config_test.c
> @@ -15,10 +15,15 @@ struct default_config_case {
> static void vkms_config_test_empty_config(struct kunit *test)
> {
> struct vkms_config *config;
> + const char *dev_name = "test";
>
> - config = vkms_config_create();
> + config = vkms_config_create(dev_name);
> KUNIT_ASSERT_NOT_ERR_OR_NULL(test, config);
>
> + /* The dev_name string and the config have different live times */
s/live times/lifetimes/
> + dev_name = NULL;
> + KUNIT_EXPECT_STREQ(test, vkms_config_get_device_name(config), "test");
> +
> vkms_config_destroy(config);
> }
>
[...]
> diff --git a/drivers/gpu/drm/vkms/vkms_config.h b/drivers/gpu/drm/vkms/vkms_config.h
> index d0868750826a..3e4f39cbe2e2 100644
> --- a/drivers/gpu/drm/vkms/vkms_config.h
> +++ b/drivers/gpu/drm/vkms/vkms_config.h
> @@ -10,12 +10,14 @@
[...]
> +/**
> + * vkms_config_get_device_name() - Return the name of the device
> + * @config: Configuration to get the device name from
Can you add here that the pointer is only valid while vkms_config is
valid?
> + */
> +static inline const char *
> +vkms_config_get_device_name(struct vkms_config *config)
> +{
> + return config->dev_name;
> +}
> +
With those modifications:
Reviewed-by: Louis Chauvet <louis.chauvet@...tlin.com>
Powered by blists - more mailing lists