drm/virtio: Checkpatch cleanup for virtio
Subsystems (5)
cover drm/virtio: Checkpatch cleanup for virtio
This patchset fixes warnings and errors found by checkpatch.pl in the drm/virtio:
* Removes return from void function;
* Adds */ in block comments to separate line;
* Adds blank line after variable declarations;
* Adds tabs at the start of a line;
* Replaces 'unsigned' for 'unsigned int';
* Removes multiple blank lines;
* Adds spaces around operators.
Rodrigo Siqueira (7):
drm/virtio: Add tabs at the start of a line drm/virtio: Add blank line after variable declarations drm/virtio: Add */ in block comments to separate line drm/virtio: Remove return from void function drm/virtio: Replace 'unsigned' for 'unsigned int' drm/virtio: Remove multiple blank lines drm/virtio: Add spaces around operators
drivers/gpu/drm/virtio/virtgpu_display.c | 7 ++++--- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- drivers/gpu/drm/virtio/virtgpu_drv.h | 8 ++++---- drivers/gpu/drm/virtio/virtgpu_fb.c | 6 +++++- drivers/gpu/drm/virtio/virtgpu_gem.c | 1 + drivers/gpu/drm/virtio/virtgpu_ioctl.c | 23 +++++++++++++---------- drivers/gpu/drm/virtio/virtgpu_prime.c | 4 ++-- drivers/gpu/drm/virtio/virtgpu_ttm.c | 4 +--- drivers/gpu/drm/virtio/virtgpu_vq.c | 13 ++++++++----- 9 files changed, 39 insertions(+), 29 deletions(-)
Signature · 1 line
2.16.2
PATCH 1/7 drm/virtio: Add tabs at the start of a line
This patch fixes the checkpatch.pl errors:
drivers/gpu/drm/virtio/virtgpu_drv.h:371: ERROR: code indent should use tabs where possible
...
--- drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- drivers/gpu/drm/virtio/virtgpu_drv.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/virtio/virtgpu_display.c +1 -1
@@ -387,7 +387,7 @@ int virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev)for (i =0 ; i < vgdev->num_scanouts; ++i)vgdev_output_init (vgdev, i); -drm_mode_config_reset (vgdev->ddev); +drm_mode_config_reset (vgdev->ddev);return 0 ; }
drivers/gpu/drm/virtio/virtgpu_drv.h +3 -3
@@ -363,12 +363,12 @@ int virtgpu_gem_prime_pin(struct drm_gem_object *obj);void virtgpu_gem_prime_unpin (struct drm_gem_object *obj);struct sg_table *virtgpu_gem_prime_get_sg_table (struct drm_gem_object *obj);struct drm_gem_object *virtgpu_gem_prime_import_sg_table ( -struct drm_device *dev,struct dma_buf_attachment *attach, -struct sg_table *sgt); +struct drm_device *dev,struct dma_buf_attachment *attach, +struct sg_table *sgt);void *virtgpu_gem_prime_vmap (struct drm_gem_object *obj);void virtgpu_gem_prime_vunmap (struct drm_gem_object *obj,void *vaddr);int virtgpu_gem_prime_mmap (struct drm_gem_object *obj, -struct vm_area_struct *vma); +struct vm_area_struct *vma);static inline struct virtio_gpu_object *virtio_gpu_object_ref (struct virtio_gpu_object *bo)
Signature · 1 line
2.16.2
PATCH 2/7 drm/virtio: Add blank line after variable declarations
In reply to Rodrigo SiqueiraThis patch fixes the checkpatch.pl warnings:
virtgpu_drv.c:57: WARNING: Missing a blank line after declarations virtgpu_display.c:99: WARNING: Missing a blank line after declarations
...
--- drivers/gpu/drm/virtio/virtgpu_display.c | 1 + drivers/gpu/drm/virtio/virtgpu_drv.c | 1 + drivers/gpu/drm/virtio/virtgpu_fb.c | 4 ++++ drivers/gpu/drm/virtio/virtgpu_gem.c | 1 + drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 ++ drivers/gpu/drm/virtio/virtgpu_vq.c | 3 +++ 6 files changed, 12 insertions(+)
drivers/gpu/drm/virtio/virtgpu_display.c +1 -0
@@ -96,6 +96,7 @@ virtio_gpu_framebuffer_init(struct drm_device *dev, {int ret;struct virtio_gpu_object *bo; + vgfb->obj = obj; bo =gem_to_virtio_gpu_obj (obj);
drivers/gpu/drm/virtio/virtgpu_drv.c +1 -0
@@ -54,6 +54,7 @@ static int virtio_gpu_probe(struct virtio_device *vdev)static void virtio_gpu_remove (struct virtio_device *vdev) {struct drm_device *dev = vdev->priv; +drm_put_dev (dev); }
drivers/gpu/drm/virtio/virtgpu_fb.c +4 -0
@@ -127,6 +127,7 @@ int virtio_gpu_surface_dirty(struct virtio_gpu_framebuffer *vgfb,int left, right, top, bottom;int i;int inc =1 ; +if (!num_clips) { num_clips =1 ; clips = &norect;
@@ -172,6 +173,7 @@ static void virtio_gpu_3d_fillrect(struct fb_info *info, const struct fb_fillrect *rect) {struct virtio_gpu_fbdev *vfbdev = info->par; +drm_fb_helper_sys_fillrect (info, rect);virtio_gpu_dirty_update (&vfbdev->vgfb, true, rect->dx, rect->dy, rect->width, rect->height);
@@ -182,6 +184,7 @@ static void virtio_gpu_3d_copyarea(struct fb_info *info, const struct fb_copyarea *area) {struct virtio_gpu_fbdev *vfbdev = info->par; +drm_fb_helper_sys_copyarea (info, area);virtio_gpu_dirty_update (&vfbdev->vgfb, true, area->dx, area->dy, area->width, area->height);
@@ -192,6 +195,7 @@ static void virtio_gpu_3d_imageblit(struct fb_info *info, const struct fb_image *image) {struct virtio_gpu_fbdev *vfbdev = info->par; +drm_fb_helper_sys_imageblit (info, image);virtio_gpu_dirty_update (&vfbdev->vgfb, true, image->dx, image->dy, image->width, image->height);
drivers/gpu/drm/virtio/virtgpu_gem.c +1 -0
@@ -124,6 +124,7 @@ int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv, {struct drm_gem_object *gobj;struct virtio_gpu_object *obj; +BUG_ON (!offset_p); gobj =drm_gem_object_lookup (file_priv, handle);if (gobj =NULL )
drivers/gpu/drm/virtio/virtgpu_ioctl.c +2 -0
@@ -83,6 +83,7 @@ static void virtio_gpu_unref_list(struct list_head *head)struct ttm_validate_buffer *buf;struct ttm_buffer_object *bo;struct virtio_gpu_object *qobj; +list_for_each_entry (buf, head, head) { bo = buf->bo; qobj = container_of(bo, struct virtio_gpu_object, tbo);
@@ -478,6 +479,7 @@ static int virtio_gpu_get_caps_ioctl(struct drm_device *dev,int ret;struct virtio_gpu_drv_cap_cache *cache_ent;void *ptr; +if (vgdev->num_capsets =0 )return -ENOSYS ;
drivers/gpu/drm/virtio/virtgpu_vq.c +3 -0
@@ -62,6 +62,7 @@ void virtio_gpu_ctrl_ack(struct virtqueue *vq) {struct drm_device *dev = vq->vdev->priv;struct virtio_gpu_device *vgdev = dev->dev_private; +schedule_work (&vgdev->ctrlq.dequeue_work); }
@@ -69,6 +70,7 @@ void virtio_gpu_cursor_ack(struct virtqueue *vq) {struct drm_device *dev = vq->vdev->priv;struct virtio_gpu_device *vgdev = dev->dev_private; +schedule_work (&vgdev->cursorq.dequeue_work); }
@@ -852,6 +854,7 @@ int virtio_gpu_object_attach(struct virtio_gpu_device *vgdev,if (!obj->pages) {int ret; + ret =virtio_gpu_object_get_sg_table (vgdev, obj);if (ret)return ret;
Signature · 1 line
2.16.2
PATCH 3/7 drm/virtio: Add */ in block comments to separate line
In reply to Rodrigo SiqueiraThis patch fixes the checkpatch.pl warning:
virtgpu_ioctl.c:551: WARNING: Block comments use a trailing */ on a separate line
...
--- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 3 ++- drivers/gpu/drm/virtio/virtgpu_prime.c | 3 ++- drivers/gpu/drm/virtio/virtgpu_vq.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/virtio/virtgpu_ioctl.c +2 -1
@@ -548,7 +548,8 @@ struct drm_ioctl_desc virtio_gpu_ioctls[DRM_VIRTIO_NUM_IOCTLS] = { DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),/* make transfer async to the main ring? - no sure, can we -thread these in the underlying GL */ +* thread these in the underlying GL +*/ DRM_IOCTL_DEF_DRV (VIRTGPU_TRANSFER_FROM_HOST , virtio_gpu_transfer_from_host_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
drivers/gpu/drm/virtio/virtgpu_prime.c +2 -1
@@ -25,7 +25,8 @@#include "virtgpu_drv.h" /* Empty Implementations as there should not be any other driver for a virtual -* device that might share buffers with virtgpu */ +* device that might share buffers with virtgpu +*/ int virtgpu_gem_prime_pin (struct drm_gem_object *obj) {
drivers/gpu/drm/virtio/virtgpu_vq.c +2 -1
@@ -383,7 +383,8 @@ static int virtio_gpu_queue_cursor(struct virtio_gpu_device *vgdev, }/* just create gem objects for userspace and long lived objects, -just use dma_alloced pages for the queue objects? */ +* just use dma_alloced pages for the queue objects? +*/ /* create a basic resource */ void virtio_gpu_cmd_create_resource(struct virtio_gpu_device *vgdev,
Signature · 1 line
2.16.2
PATCH 4/7 drm/virtio: Remove return from void function
In reply to Rodrigo SiqueiraThis patch fixes the checkpatch.pl warning:
virtgpu_ttm.c:181: WARNING: void function return statements are not generally useful
...
--- drivers/gpu/drm/virtio/virtgpu_ttm.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/virtio/virtgpu_ttm.c +0 -2
@@ -177,7 +177,6 @@ static void ttm_bo_man_put_node(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem) { mem->mm_node = (void *)NULL ; -return ; } static int ttm_bo_man_init(struct ttm_mem_type_manager *man,
@@ -244,7 +243,6 @@ static void virtio_gpu_evict_flags(struct ttm_buffer_object *bo, placement->busy_placement = &placements; placement->num_placement =1 ; placement->num_busy_placement =1 ; -return ; } static int virtio_gpu_verify_access(struct ttm_buffer_object *bo,
Signature · 1 line
2.16.2
PATCH 5/7 drm/virtio: Replace 'unsigned' for 'unsigned int'
In reply to Rodrigo SiqueiraThis patch fixes the checkpatch.pl warning:
drivers/gpu/drm/virtio/virtgpu_display.c:64: WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
...
--- drivers/gpu/drm/virtio/virtgpu_display.c | 4 ++-- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 +- drivers/gpu/drm/virtio/virtgpu_fb.c | 2 +- drivers/gpu/drm/virtio/virtgpu_ttm.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/virtio/virtgpu_display.c +2 -2
@@ -61,9 +61,9 @@ static void virtio_gpu_user_framebuffer_destroy(struct drm_framebuffer *fb)static int virtio_gpu_framebuffer_surface_dirty (struct drm_framebuffer *fb,struct drm_file *file_priv, -unsigned flags,unsigned color, +unsigned int flags,unsigned int color,struct drm_clip_rect *clips, -unsigned num_clips) +unsigned int num_clips) {struct virtio_gpu_framebuffer *virtio_gpu_fb =to_virtio_gpu_framebuffer (fb);
drivers/gpu/drm/virtio/virtgpu_drv.h +1 -1
@@ -246,7 +246,7 @@ int virtio_gpu_fbdev_init(struct virtio_gpu_device *vgdev);void virtio_gpu_fbdev_fini (struct virtio_gpu_device *vgdev);int virtio_gpu_surface_dirty (struct virtio_gpu_framebuffer *qfb,struct drm_clip_rect *clips, -unsigned num_clips); +unsigned int num_clips);/* virtio vg */ int virtio_gpu_alloc_vbufs (struct virtio_gpu_device *vgdev);void virtio_gpu_free_vbufs (struct virtio_gpu_device *vgdev);
drivers/gpu/drm/virtio/virtgpu_fb.c +1 -1
@@ -118,7 +118,7 @@ static int virtio_gpu_dirty_update(struct virtio_gpu_framebuffer *fb,int virtio_gpu_surface_dirty (struct virtio_gpu_framebuffer *vgfb,struct drm_clip_rect *clips, -unsigned num_clips) +unsigned int num_clips) {struct virtio_gpu_device *vgdev = vgfb->base.dev->dev_private;struct virtio_gpu_object *obj =gem_to_virtio_gpu_obj (vgfb->obj);
drivers/gpu/drm/virtio/virtgpu_ttm.c +1 -1
@@ -224,7 +224,7 @@ static int virtio_gpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, man->default_caching =TTM_PL_FLAG_CACHED ;break ;default : -DRM_ERROR ("Unsupported memory type %u\n" , (unsigned )type); +DRM_ERROR ("Unsupported memory type %u\n" , (unsigned int )type);return -EINVAL ; }return 0 ;
Signature · 1 line
2.16.2
PATCH 6/7 drm/virtio: Remove multiple blank lines
In reply to Rodrigo SiqueiraThis patch fixes the checkpatch.pl check:
virtgpu_drv.c:116: CHECK: Please don't use multiple blank lines virtgpu_vq.c:599: CHECK: Please don't use multiple blank lines virtgpu_prime.c:42: CHECK: Please don't use multiple blank lines
--- drivers/gpu/drm/virtio/virtgpu_drv.c | 1 - drivers/gpu/drm/virtio/virtgpu_prime.c | 1 - drivers/gpu/drm/virtio/virtgpu_vq.c | 1 - 3 files changed, 3 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drv.c +0 -1
@@ -113,7 +113,6 @@ static const struct file_operations virtio_gpu_driver_fops = { .llseek = noop_llseek, }; -static struct drm_driver driver = { .driver_features =DRIVER_MODESET |DRIVER_GEM |DRIVER_PRIME |DRIVER_RENDER |DRIVER_ATOMIC , .load = virtio_gpu_driver_load,
drivers/gpu/drm/virtio/virtgpu_prime.c +0 -1
@@ -39,7 +39,6 @@ void virtgpu_gem_prime_unpin(struct drm_gem_object *obj)WARN_ONCE (1 ,"not implemented" ); } -struct sg_table *virtgpu_gem_prime_get_sg_table (struct drm_gem_object *obj) {WARN_ONCE (1 ,"not implemented" );
drivers/gpu/drm/virtio/virtgpu_vq.c +0 -1
@@ -596,7 +596,6 @@ static void virtio_gpu_cmd_capset_cb(struct virtio_gpu_device *vgdev,wake_up (&vgdev->resp_wq); } -int virtio_gpu_cmd_get_display_info (struct virtio_gpu_device *vgdev) {struct virtio_gpu_ctrl_hdr *cmd_p;
Signature · 1 line
2.16.2
PATCH 7/7 drm/virtio: Add spaces around operators
In reply to Rodrigo SiqueiraThis patch fixes the checkpatch.pl check:
virtgpu_ioctl.c:535: CHECK: spaces preferred around that '|' (ctx:VxV) virtgpu_vq.c:277: CHECK: spaces preferred around that '+' (ctx:VxV)
...
--- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 18 +++++++++--------- drivers/gpu/drm/virtio/virtgpu_vq.c | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-)
drivers/gpu/drm/virtio/virtgpu_ioctl.c +9 -9
@@ -532,34 +532,34 @@ static int virtio_gpu_get_caps_ioctl(struct drm_device *dev,struct drm_ioctl_desc virtio_gpu_ioctls[DRM_VIRTIO_NUM_IOCTLS ] = {DRM_IOCTL_DEF_DRV (VIRTGPU_MAP , virtio_gpu_map_ioctl, -DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ), +DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ),DRM_IOCTL_DEF_DRV (VIRTGPU_EXECBUFFER , virtio_gpu_execbuffer_ioctl, -DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ), +DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ),DRM_IOCTL_DEF_DRV (VIRTGPU_GETPARAM , virtio_gpu_getparam_ioctl, -DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ), +DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ),DRM_IOCTL_DEF_DRV (VIRTGPU_RESOURCE_CREATE , virtio_gpu_resource_create_ioctl, -DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ), +DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ),DRM_IOCTL_DEF_DRV (VIRTGPU_RESOURCE_INFO , virtio_gpu_resource_info_ioctl, -DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ), +DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ),/* make transfer async to the main ring? - no sure, can we * thread these in the underlying GL */ DRM_IOCTL_DEF_DRV (VIRTGPU_TRANSFER_FROM_HOST , virtio_gpu_transfer_from_host_ioctl, -DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ), +DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ),DRM_IOCTL_DEF_DRV (VIRTGPU_TRANSFER_TO_HOST , virtio_gpu_transfer_to_host_ioctl, -DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ), +DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ),DRM_IOCTL_DEF_DRV (VIRTGPU_WAIT , virtio_gpu_wait_ioctl, -DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ), +DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ),DRM_IOCTL_DEF_DRV (VIRTGPU_GET_CAPS , virtio_gpu_get_caps_ioctl, -DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ), +DRM_AUTH |DRM_UNLOCKED |DRM_RENDER_ALLOW ), };
drivers/gpu/drm/virtio/virtgpu_vq.c +3 -3
@@ -274,7 +274,7 @@ static int virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev,return -ENODEV ;sg_init_one (&vcmd, vbuf->buf, vbuf->size); - sgs[outcnt+incnt] = &vcmd; + sgs[outcnt + incnt] = &vcmd; outcnt++;if (vbuf->data_size) {
@@ -709,8 +709,8 @@ void virtio_gpu_cmd_context_create(struct virtio_gpu_device *vgdev, uint32_t id, cmd_p->hdr.type =cpu_to_le32 (VIRTIO_GPU_CMD_CTX_CREATE ); cmd_p->hdr.ctx_id =cpu_to_le32 (id); cmd_p->nlen =cpu_to_le32 (nlen); -strncpy (cmd_p->debug_name, name,sizeof (cmd_p->debug_name)-1 ); - cmd_p->debug_name[sizeof (cmd_p->debug_name)-1 ] =0 ; +strncpy (cmd_p->debug_name, name,sizeof (cmd_p->debug_name) -1 ); + cmd_p->debug_name[sizeof (cmd_p->debug_name) -1 ] =0 ;virtio_gpu_queue_ctrl_buffer (vgdev, vbuf); }
Signature · 1 line
2.16.2
Patches 1 to 7 are:
Quoted 38 lines · Rodrigo Siqueira
This patchset fixes warnings and errors found by checkpatch.pl in the drm/virtio:
* Removes return from void function;
* Adds */ in block comments to separate line;
* Adds blank line after variable declarations;
* Adds tabs at the start of a line;
* Replaces 'unsigned' for 'unsigned int';
* Removes multiple blank lines;
* Adds spaces around operators.Rodrigo Siqueira (7):
drm/virtio: Add tabs at the start of a line drm/virtio: Add blank line after variable declarations drm/virtio: Add */ in block comments to separate line drm/virtio: Remove return from void function drm/virtio: Replace 'unsigned' for 'unsigned int' drm/virtio: Remove multiple blank lines drm/virtio: Add spaces around operatorsdrivers/gpu/drm/virtio/virtgpu_display.c | 7 ++++--- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- drivers/gpu/drm/virtio/virtgpu_drv.h | 8 ++++---- drivers/gpu/drm/virtio/virtgpu_fb.c | 6 +++++- drivers/gpu/drm/virtio/virtgpu_gem.c | 1 + drivers/gpu/drm/virtio/virtgpu_ioctl.c | 23 +++++++++++++---------- drivers/gpu/drm/virtio/virtgpu_prime.c | 4 ++-- drivers/gpu/drm/virtio/virtgpu_ttm.c | 4 +--- drivers/gpu/drm/virtio/virtgpu_vq.c | 13 ++++++++----- 9 files changed, 39 insertions(+), 29 deletions(-)--
2.16.2_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Gerd Hoffmann
maintainerQuoted 2 lines · Rodrigo Siqueira
This patchset fixes warnings and errors found by checkpatch.pl in the drm/virtio:
Added to drm-qemu queue, will land in drm-misc soon.
thanks,
Gerd
Gerd Hoffmann
maintainerQuoted 2 lines · Rodrigo Siqueira
This patchset fixes warnings and errors found by checkpatch.pl in the drm/virtio:
Added to drm-qemu queue, will land in drm-misc soon.
thanks,
Gerd