Skip to contentSkip to conversation

drm/virtio: Use UUID API for importing the UUID

PATCH Superseded Andy Shevchenko 3 participants 3 messages Oct 12, 2020 – Oct 13, 2020

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/virtio: Use UUID API for importing the UUID

There is import_uuid() function which imports u8 array to the uuid_t. Use it instead of open coding variant.

This allows to hide the uuid_t internals.

---
 drivers/gpu/drm/virtio/virtgpu_vq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_vq.c +1 -1
index 07945ca238e2..8944cc0bf8eb 100644
@@ -1129,7 +1129,7 @@ static void virtio_gpu_cmd_resource_uuid_cb(struct virtio_gpu_device *vgdev,
 
 	if (resp_type == VIRTIO_GPU_RESP_OK_RESOURCE_UUID &&
 	    obj->uuid_state == UUID_INITIALIZING) {
-		memcpy(&obj->uuid.b, resp->uuid, sizeof(obj->uuid.b));
+		import_uuid(&obj->uuid, resp->uuid);
 		obj->uuid_state = UUID_INITIALIZED;
 	} else {
 		obj->uuid_state = UUID_INITIALIZATION_FAILED;
Signature · 6 lines
2.28.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Andy Shevchenko

There is import_uuid() function which imports u8 array to the uuid_t. Use it instead of open coding variant.

This allows to hide the uuid_t internals.

---
 drivers/gpu/drm/virtio/virtgpu_vq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_vq.c +1 -2
index 07945ca238e2..8944cc0bf8eb 100644
@@ -1129,7 +1129,7 @@ static void virtio_gpu_cmd_resource_uuid_cb(struct virtio_gpu_device *vgdev,
 
        if (resp_type == VIRTIO_GPU_RESP_OK_RESOURCE_UUID &&
            obj->uuid_state == UUID_INITIALIZING) {
-               memcpy(&obj->uuid.b, resp->uuid, sizeof(obj->uuid.b));
+               import_uuid(&obj->uuid, resp->uuid);
                obj->uuid_state = UUID_INITIALIZED;
        } else {
                obj->uuid_state = UUID_INITIALIZATION_FAILED;
--
Quoted 2 lines

2.28.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel