Skip to content

Commit 38580d1

Browse files
krathuldigetx
authored andcommitted
drm/virtio: clean up minor codestyle issues
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
1 parent 1e17ed8 commit 38580d1

5 files changed

Lines changed: 16 additions & 15 deletions

File tree

drivers/gpu/drm/virtio/virtgpu_display.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,8 @@ static void virtio_gpu_crtc_atomic_flush(struct drm_crtc *crtc,
131131
* in the plane update callback, and here we just check
132132
* whenever we must force the modeset.
133133
*/
134-
if (drm_atomic_crtc_needs_modeset(crtc_state)) {
134+
if (drm_atomic_crtc_needs_modeset(crtc_state))
135135
output->needs_modeset = true;
136-
}
137136
}
138137

139138
static const struct drm_crtc_helper_funcs virtio_gpu_crtc_helper_funcs = {

drivers/gpu/drm/virtio/virtgpu_kms.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,18 @@ int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
162162
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_VIRGL))
163163
vgdev->has_virgl_3d = true;
164164
#endif
165-
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_EDID)) {
165+
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_EDID))
166166
vgdev->has_edid = true;
167-
}
168-
if (virtio_has_feature(vgdev->vdev, VIRTIO_RING_F_INDIRECT_DESC)) {
167+
168+
if (virtio_has_feature(vgdev->vdev, VIRTIO_RING_F_INDIRECT_DESC))
169169
vgdev->has_indirect = true;
170-
}
171-
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_UUID)) {
170+
171+
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_UUID))
172172
vgdev->has_resource_assign_uuid = true;
173-
}
174-
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_BLOB)) {
173+
174+
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_BLOB))
175175
vgdev->has_resource_blob = true;
176-
}
176+
177177
if (virtio_get_shm_region(vgdev->vdev, &vgdev->host_visible_region,
178178
VIRTIO_GPU_SHM_ID_HOST_VISIBLE)) {
179179
if (!devm_request_mem_region(&vgdev->vdev->dev,
@@ -193,9 +193,9 @@ int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
193193
(unsigned long)vgdev->host_visible_region.addr,
194194
(unsigned long)vgdev->host_visible_region.len);
195195
}
196-
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_CONTEXT_INIT)) {
196+
197+
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_CONTEXT_INIT))
197198
vgdev->has_context_init = true;
198-
}
199199

200200
DRM_INFO("features: %cvirgl %cedid %cresource_blob %chost_visible",
201201
vgdev->has_virgl_3d ? '+' : '-',

drivers/gpu/drm/virtio/virtgpu_object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ int virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev, uint32_t *resid)
4747
*resid = handle + 1;
4848
} else {
4949
int handle = ida_alloc(&vgdev->resource_ida, GFP_KERNEL);
50+
5051
if (handle < 0)
5152
return handle;
5253
*resid = handle + 1;
@@ -56,9 +57,8 @@ int virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev, uint32_t *resid)
5657

5758
static void virtio_gpu_resource_id_put(struct virtio_gpu_device *vgdev, uint32_t id)
5859
{
59-
if (!virtio_gpu_virglrenderer_workaround) {
60+
if (!virtio_gpu_virglrenderer_workaround)
6061
ida_free(&vgdev->resource_ida, id - 1);
61-
}
6262
}
6363

6464
void virtio_gpu_cleanup_object(struct virtio_gpu_object *bo)

drivers/gpu/drm/virtio/virtgpu_plane.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,
120120
crtc_state = drm_atomic_get_crtc_state(state,
121121
new_plane_state->crtc);
122122
if (IS_ERR(crtc_state))
123-
return PTR_ERR(crtc_state);
123+
return PTR_ERR(crtc_state);
124124

125125
ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state,
126126
DRM_PLANE_NO_SCALING,

drivers/gpu/drm/virtio/virtgpu_vq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ void virtio_gpu_dequeue_ctrl_func(struct work_struct *work)
248248
if (resp->type != cpu_to_le32(VIRTIO_GPU_RESP_OK_NODATA)) {
249249
if (le32_to_cpu(resp->type) >= VIRTIO_GPU_RESP_ERR_UNSPEC) {
250250
struct virtio_gpu_ctrl_hdr *cmd;
251+
251252
cmd = virtio_gpu_vbuf_ctrl_hdr(entry);
252253
DRM_ERROR_RATELIMITED("response 0x%x (command 0x%x)\n",
253254
le32_to_cpu(resp->type),
@@ -468,6 +469,7 @@ static int virtio_gpu_queue_fenced_ctrl_buffer(struct virtio_gpu_device *vgdev,
468469
if (vbuf->data_size) {
469470
if (is_vmalloc_addr(vbuf->data_buf)) {
470471
int sg_ents;
472+
471473
sgt = vmalloc_to_sgt(vbuf->data_buf, vbuf->data_size,
472474
&sg_ents);
473475
if (!sgt) {

0 commit comments

Comments
 (0)