]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/virtio: clean up minor codestyle issues
authorAthul Raj Kollareth <krathul3152@gmail.com>
Wed, 13 Aug 2025 06:21:05 +0000 (11:51 +0530)
committerDmitry Osipenko <dmitry.osipenko@collabora.com>
Wed, 20 Aug 2025 10:36:45 +0000 (13:36 +0300)
Fix codestyle warnings and errors generated by CHECKPATCH in virtio
source files.

Signed-off-by: Athul Raj Kollareth <krathul3152@gmail.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://lore.kernel.org/r/20250813062109.5326-1-krathul3152@gmail.com
drivers/gpu/drm/virtio/virtgpu_display.c
drivers/gpu/drm/virtio/virtgpu_kms.c
drivers/gpu/drm/virtio/virtgpu_object.c
drivers/gpu/drm/virtio/virtgpu_plane.c
drivers/gpu/drm/virtio/virtgpu_vq.c

index e5805ca646c7227601919b6e7d1f3efd85e17a38..c3315935d8bc467fbaf57cb26363223526d43ed0 100644 (file)
@@ -131,9 +131,8 @@ static void virtio_gpu_crtc_atomic_flush(struct drm_crtc *crtc,
         * in the plane update callback, and here we just check
         * whenever we must force the modeset.
         */
-       if (drm_atomic_crtc_needs_modeset(crtc_state)) {
+       if (drm_atomic_crtc_needs_modeset(crtc_state))
                output->needs_modeset = true;
-       }
 }
 
 static const struct drm_crtc_helper_funcs virtio_gpu_crtc_helper_funcs = {
index 7dfb2006c561ca13b15d979ddb8bf2d753e35dad..1c15cbf326b78c204a7d4f172a307ef65cf5a8f2 100644 (file)
@@ -162,18 +162,18 @@ int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
        if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_VIRGL))
                vgdev->has_virgl_3d = true;
 #endif
-       if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_EDID)) {
+       if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_EDID))
                vgdev->has_edid = true;
-       }
-       if (virtio_has_feature(vgdev->vdev, VIRTIO_RING_F_INDIRECT_DESC)) {
+
+       if (virtio_has_feature(vgdev->vdev, VIRTIO_RING_F_INDIRECT_DESC))
                vgdev->has_indirect = true;
-       }
-       if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_UUID)) {
+
+       if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_UUID))
                vgdev->has_resource_assign_uuid = true;
-       }
-       if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_BLOB)) {
+
+       if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_BLOB))
                vgdev->has_resource_blob = true;
-       }
+
        if (virtio_get_shm_region(vgdev->vdev, &vgdev->host_visible_region,
                                  VIRTIO_GPU_SHM_ID_HOST_VISIBLE)) {
                if (!devm_request_mem_region(&vgdev->vdev->dev,
@@ -193,9 +193,9 @@ int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
                            (unsigned long)vgdev->host_visible_region.addr,
                            (unsigned long)vgdev->host_visible_region.len);
        }
-       if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_CONTEXT_INIT)) {
+
+       if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_CONTEXT_INIT))
                vgdev->has_context_init = true;
-       }
 
        DRM_INFO("features: %cvirgl %cedid %cresource_blob %chost_visible",
                 vgdev->has_virgl_3d    ? '+' : '-',
index 5517cff8715c2ab3c6761a5e4f1e7d1c49cd558d..e6363c887500af6e82a5df0ca444e7030cc77b75 100644 (file)
@@ -47,6 +47,7 @@ int virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev, uint32_t *resid)
                *resid = handle + 1;
        } else {
                int handle = ida_alloc(&vgdev->resource_ida, GFP_KERNEL);
+
                if (handle < 0)
                        return handle;
                *resid = handle + 1;
@@ -56,9 +57,8 @@ int virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev, uint32_t *resid)
 
 static void virtio_gpu_resource_id_put(struct virtio_gpu_device *vgdev, uint32_t id)
 {
-       if (!virtio_gpu_virglrenderer_workaround) {
+       if (!virtio_gpu_virglrenderer_workaround)
                ida_free(&vgdev->resource_ida, id - 1);
-       }
 }
 
 void virtio_gpu_cleanup_object(struct virtio_gpu_object *bo)
index 698ea7adb951170f940a9d26e889faeb13ce5258..29e4b458ae57315c0d69cc958b386e733fe0b6e4 100644 (file)
@@ -120,7 +120,7 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,
        crtc_state = drm_atomic_get_crtc_state(state,
                                               new_plane_state->crtc);
        if (IS_ERR(crtc_state))
-                return PTR_ERR(crtc_state);
+               return PTR_ERR(crtc_state);
 
        ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state,
                                                  DRM_PLANE_NO_SCALING,
index 55a15e247dd1ad53a2b43b19fca8879b956f0e1a..8181b22b9b46a1c69587c2a7b06f195fbcf143a6 100644 (file)
@@ -248,6 +248,7 @@ void virtio_gpu_dequeue_ctrl_func(struct work_struct *work)
                if (resp->type != cpu_to_le32(VIRTIO_GPU_RESP_OK_NODATA)) {
                        if (le32_to_cpu(resp->type) >= VIRTIO_GPU_RESP_ERR_UNSPEC) {
                                struct virtio_gpu_ctrl_hdr *cmd;
+
                                cmd = virtio_gpu_vbuf_ctrl_hdr(entry);
                                DRM_ERROR_RATELIMITED("response 0x%x (command 0x%x)\n",
                                                      le32_to_cpu(resp->type),
@@ -468,6 +469,7 @@ static int virtio_gpu_queue_fenced_ctrl_buffer(struct virtio_gpu_device *vgdev,
        if (vbuf->data_size) {
                if (is_vmalloc_addr(vbuf->data_buf)) {
                        int sg_ents;
+
                        sgt = vmalloc_to_sgt(vbuf->data_buf, vbuf->data_size,
                                             &sg_ents);
                        if (!sgt) {