drm/ttm: Fix a few sparse warnings
Subsystems (7)
PATCH 1/1 drm/ttm: Fix a few sparse warnings
From: Thierry Reding <[email protected]>
The final parameter to ttm_bo_reserve() is a pointer, therefore callers should use NULL instead of 0.
Fixes a bunch of sparse warnings of this type:
warning: Using plain integer as NULL pointer
Signed-off-by Thierry Reding <[email protected]>
--- drivers/gpu/drm/ast/ast_drv.h | 2 +- drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- drivers/gpu/drm/bochs/bochs_kms.c | 4 ++-- drivers/gpu/drm/cirrus/cirrus_drv.h | 2 +- drivers/gpu/drm/mgag200/mgag200_drv.h | 2 +- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++--- drivers/gpu/drm/nouveau/nouveau_gem.c | 4 ++-- drivers/gpu/drm/qxl/qxl_object.h | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c | 6 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-)
drivers/gpu/drm/ast/ast_drv.h +1 -1
@@ -362,7 +362,7 @@ static inline int ast_bo_reserve(struct ast_bo *bo, bool no_wait) {int ret; - ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,0 ); + ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,NULL );if (ret) {if (ret != -ERESTARTSYS && ret != -EBUSY )DRM_ERROR ("reserve failed %p\n" , bo);
drivers/gpu/drm/bochs/bochs_fbdev.c +1 -1
@@ -72,7 +72,7 @@ static int bochsfb_create(struct drm_fb_helper *helper, bo =gem_to_bochs_bo (gobj); - ret =ttm_bo_reserve (&bo->bo, true, false, false,0 ); + ret =ttm_bo_reserve (&bo->bo, true, false, false,NULL );if (ret)return ret;
drivers/gpu/drm/bochs/bochs_kms.c +2 -2
@@ -53,7 +53,7 @@ static int bochs_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,if (old_fb) { bochs_fb =to_bochs_framebuffer (old_fb); bo =gem_to_bochs_bo (bochs_fb->obj); - ret =ttm_bo_reserve (&bo->bo, true, false, false,0 ); + ret =ttm_bo_reserve (&bo->bo, true, false, false,NULL );if (ret) {DRM_ERROR ("failed to reserve old_fb bo\n" ); }else {
@@ -67,7 +67,7 @@ static int bochs_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, bochs_fb =to_bochs_framebuffer (crtc->primary->fb); bo =gem_to_bochs_bo (bochs_fb->obj); - ret =ttm_bo_reserve (&bo->bo, true, false, false,0 ); + ret =ttm_bo_reserve (&bo->bo, true, false, false,NULL );if (ret)return ret;
drivers/gpu/drm/cirrus/cirrus_drv.h +1 -1
@@ -241,7 +241,7 @@ static inline int cirrus_bo_reserve(struct cirrus_bo *bo, bool no_wait) {int ret; - ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,0 ); + ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,NULL );if (ret) {if (ret != -ERESTARTSYS && ret != -EBUSY )DRM_ERROR ("reserve failed %p\n" , bo);
drivers/gpu/drm/mgag200/mgag200_drv.h +1 -1
@@ -280,7 +280,7 @@ static inline int mgag200_bo_reserve(struct mgag200_bo *bo, bool no_wait) {int ret; - ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,0 ); + ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,NULL );if (ret) {if (ret != -ERESTARTSYS && ret != -EBUSY )DRM_ERROR ("reserve failed %p\n" , bo);
drivers/gpu/drm/nouveau/nouveau_bo.c +3 -3
@@ -310,7 +310,7 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t memtype)struct ttm_buffer_object *bo = &nvbo->bo;int ret; - ret =ttm_bo_reserve (bo, false, false, false,0 ); + ret =ttm_bo_reserve (bo, false, false, false,NULL );if (ret) goto out;
@@ -351,7 +351,7 @@ nouveau_bo_unpin(struct nouveau_bo *nvbo)struct ttm_buffer_object *bo = &nvbo->bo;int ret, ref; - ret =ttm_bo_reserve (bo, false, false, false,0 ); + ret =ttm_bo_reserve (bo, false, false, false,NULL );if (ret)return ret;
@@ -386,7 +386,7 @@ nouveau_bo_map(struct nouveau_bo *nvbo) {int ret; - ret =ttm_bo_reserve (&nvbo->bo, false, false, false,0 ); + ret =ttm_bo_reserve (&nvbo->bo, false, false, false,NULL );if (ret)return ret;
drivers/gpu/drm/nouveau/nouveau_gem.c +2 -2
@@ -61,7 +61,7 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv)if (!cli->base.vm)return 0 ; - ret =ttm_bo_reserve (&nvbo->bo, false, false, false,0 ); + ret =ttm_bo_reserve (&nvbo->bo, false, false, false,NULL );if (ret)return ret;
@@ -132,7 +132,7 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv)if (!cli->base.vm)return ; - ret =ttm_bo_reserve (&nvbo->bo, false, false, false,0 ); + ret =ttm_bo_reserve (&nvbo->bo, false, false, false,NULL );if (ret)return ;
drivers/gpu/drm/qxl/qxl_object.h +2 -2
@@ -31,7 +31,7 @@ static inline int qxl_bo_reserve(struct qxl_bo *bo, bool no_wait) {int r; - r =ttm_bo_reserve (&bo->tbo, true, no_wait, false,0 ); + r =ttm_bo_reserve (&bo->tbo, true, no_wait, false,NULL );if (unlikely (r !=0 )) {if (r != -ERESTARTSYS ) {struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
@@ -67,7 +67,7 @@ static inline int qxl_bo_wait(struct qxl_bo *bo, u32 *mem_type, {int r; - r =ttm_bo_reserve (&bo->tbo, true, no_wait, false,0 ); + r =ttm_bo_reserve (&bo->tbo, true, no_wait, false,NULL );if (unlikely (r !=0 )) {if (r != -ERESTARTSYS ) {struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c +3 -3
@@ -61,7 +61,7 @@ int vmw_dmabuf_to_placement(struct vmw_private *dev_priv,vmw_execbuf_release_pinned_bo (dev_priv); - ret =ttm_bo_reserve (bo, interruptible, false, false,0 ); + ret =ttm_bo_reserve (bo, interruptible, false, false,NULL );if (unlikely (ret !=0 )) goto err;
@@ -105,7 +105,7 @@ int vmw_dmabuf_to_vram_or_gmr(struct vmw_private *dev_priv,if (pin)vmw_execbuf_release_pinned_bo (dev_priv); - ret =ttm_bo_reserve (bo, interruptible, false, false,0 ); + ret =ttm_bo_reserve (bo, interruptible, false, false,NULL );if (unlikely (ret !=0 )) goto err;
@@ -212,7 +212,7 @@ int vmw_dmabuf_to_start_of_vram(struct vmw_private *dev_priv,if (pin)vmw_execbuf_release_pinned_bo (dev_priv); - ret =ttm_bo_reserve (bo, interruptible, false, false,0 ); + ret =ttm_bo_reserve (bo, interruptible, false, false,NULL );if (unlikely (ret !=0 )) goto err_unlock;
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1 -1
@@ -316,7 +316,7 @@ static int vmw_dummy_query_bo_create(struct vmw_private *dev_priv)if (unlikely (ret !=0 ))return ret; - ret =ttm_bo_reserve (bo, false, true, false,0 ); + ret =ttm_bo_reserve (bo, false, true, false,NULL );BUG_ON (ret !=0 ); ret =ttm_bo_kmap (bo,0 ,1 , &map);
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +2 -2
@@ -136,7 +136,7 @@ int vmw_cursor_update_dmabuf(struct vmw_private *dev_priv, kmap_offset =0 ; kmap_num = (width*height*4 +PAGE_SIZE -1 ) >>PAGE_SHIFT ; - ret =ttm_bo_reserve (&dmabuf->base, true, false, false,0 ); + ret =ttm_bo_reserve (&dmabuf->base, true, false, false,NULL );if (unlikely (ret !=0 )) {DRM_ERROR ("reserve failed\n" );return -EINVAL ;
@@ -343,7 +343,7 @@ void vmw_kms_cursor_snoop(struct vmw_surface *srf, kmap_offset = cmd->dma.guest.ptr.offset >>PAGE_SHIFT ; kmap_num = (64 *64 *4 ) >>PAGE_SHIFT ; - ret =ttm_bo_reserve (bo, true, false, false,0 ); + ret =ttm_bo_reserve (bo, true, false, false,NULL );if (unlikely (ret !=0 )) {DRM_ERROR ("reserve failed\n" );return ;
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +1 -1
@@ -127,7 +127,7 @@ static void vmw_resource_release(struct kref *kref)if (res->backup) {struct ttm_buffer_object *bo = &res->backup->base; -ttm_bo_reserve (bo, false, false, false,0 ); +ttm_bo_reserve (bo, false, false, false,NULL );if (!list_empty (&res->mob_head) && res->func->unbind !=NULL ) {struct ttm_validate_buffer val_buf;
Signature · 1 line
2.0.1
Quoted 10 lines · Thierry Reding
From: Thierry Reding <[email protected]>
The final parameter to
ttm_bo_reserve()is a pointer, therefore callers should use NULL instead of 0.Fixes a bunch of sparse warnings of this type:
warning: Using plain integer as NULL pointer
Signed-off-by Thierry Reding <[email protected]>
Reviewed-by Alex Deucher <[email protected]>
Quoted 250 lines
--- drivers/gpu/drm/ast/ast_drv.h | 2 +- drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- drivers/gpu/drm/bochs/bochs_kms.c | 4 ++-- drivers/gpu/drm/cirrus/cirrus_drv.h | 2 +- drivers/gpu/drm/mgag200/mgag200_drv.h | 2 +- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++--- drivers/gpu/drm/nouveau/nouveau_gem.c | 4 ++-- drivers/gpu/drm/qxl/qxl_object.h | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c | 6 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-)drivers/gpu/drm/ast/ast_drv.h +1
-1@@ -362,7 +362,7 @@ static inline int ast_bo_reserve(struct ast_bo *bo, bool no_wait) {int ret; - ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,0 ); + ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,NULL );if (ret) {if (ret != -ERESTARTSYS && ret != -EBUSY )DRM_ERROR ("reserve failed %p\n" , bo);drivers/gpu/drm/bochs/bochs_fbdev.c +1
-1@@ -72,7 +72,7 @@ static int bochsfb_create(struct drm_fb_helper *helper, bo =gem_to_bochs_bo (gobj); - ret =ttm_bo_reserve (&bo->bo, true, false, false,0 ); + ret =ttm_bo_reserve (&bo->bo, true, false, false,NULL );if (ret)return ret;drivers/gpu/drm/bochs/bochs_kms.c +2
-2@@ -53,7 +53,7 @@ static int bochs_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,if (old_fb) { bochs_fb =to_bochs_framebuffer (old_fb); bo =gem_to_bochs_bo (bochs_fb->obj); - ret =ttm_bo_reserve (&bo->bo, true, false, false,0 ); + ret =ttm_bo_reserve (&bo->bo, true, false, false,NULL );if (ret) {DRM_ERROR ("failed to reserve old_fb bo\n" ); }else {@@ -67,7 +67,7 @@ static int bochs_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, bochs_fb =to_bochs_framebuffer (crtc->primary->fb); bo =gem_to_bochs_bo (bochs_fb->obj); - ret =ttm_bo_reserve (&bo->bo, true, false, false,0 ); + ret =ttm_bo_reserve (&bo->bo, true, false, false,NULL );if (ret)return ret;drivers/gpu/drm/cirrus/cirrus_drv.h +1
-1@@ -241,7 +241,7 @@ static inline int cirrus_bo_reserve(struct cirrus_bo *bo, bool no_wait) {int ret; - ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,0 ); + ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,NULL );if (ret) {if (ret != -ERESTARTSYS && ret != -EBUSY )DRM_ERROR ("reserve failed %p\n" , bo);drivers/gpu/drm/mgag200/mgag200_drv.h +1
-1@@ -280,7 +280,7 @@ static inline int mgag200_bo_reserve(struct mgag200_bo *bo, bool no_wait) {int ret; - ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,0 ); + ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,NULL );if (ret) {if (ret != -ERESTARTSYS && ret != -EBUSY )DRM_ERROR ("reserve failed %p\n" , bo);drivers/gpu/drm/nouveau/nouveau_bo.c +3
-3@@ -310,7 +310,7 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t memtype)struct ttm_buffer_object *bo = &nvbo->bo;int ret; - ret =ttm_bo_reserve (bo, false, false, false,0 ); + ret =ttm_bo_reserve (bo, false, false, false,NULL );if (ret) goto out;@@ -351,7 +351,7 @@ nouveau_bo_unpin(struct nouveau_bo *nvbo)struct ttm_buffer_object *bo = &nvbo->bo;int ret, ref; - ret =ttm_bo_reserve (bo, false, false, false,0 ); + ret =ttm_bo_reserve (bo, false, false, false,NULL );if (ret)return ret;@@ -386,7 +386,7 @@ nouveau_bo_map(struct nouveau_bo *nvbo) {int ret; - ret =ttm_bo_reserve (&nvbo->bo, false, false, false,0 ); + ret =ttm_bo_reserve (&nvbo->bo, false, false, false,NULL );if (ret)return ret;drivers/gpu/drm/nouveau/nouveau_gem.c +2
-2@@ -61,7 +61,7 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv)if (!cli->base.vm)return 0 ; - ret =ttm_bo_reserve (&nvbo->bo, false, false, false,0 ); + ret =ttm_bo_reserve (&nvbo->bo, false, false, false,NULL );if (ret)return ret;@@ -132,7 +132,7 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv)if (!cli->base.vm)return ; - ret =ttm_bo_reserve (&nvbo->bo, false, false, false,0 ); + ret =ttm_bo_reserve (&nvbo->bo, false, false, false,NULL );if (ret)return ;drivers/gpu/drm/qxl/qxl_object.h +2
-2@@ -31,7 +31,7 @@ static inline int qxl_bo_reserve(struct qxl_bo *bo, bool no_wait) {int r; - r =ttm_bo_reserve (&bo->tbo, true, no_wait, false,0 ); + r =ttm_bo_reserve (&bo->tbo, true, no_wait, false,NULL );if (unlikely (r !=0 )) {if (r != -ERESTARTSYS ) {struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;@@ -67,7 +67,7 @@ static inline int qxl_bo_wait(struct qxl_bo *bo, u32 *mem_type, {int r; - r =ttm_bo_reserve (&bo->tbo, true, no_wait, false,0 ); + r =ttm_bo_reserve (&bo->tbo, true, no_wait, false,NULL );if (unlikely (r !=0 )) {if (r != -ERESTARTSYS ) {struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c +3
-3@@ -61,7 +61,7 @@ int vmw_dmabuf_to_placement(struct vmw_private *dev_priv,vmw_execbuf_release_pinned_bo (dev_priv); - ret =ttm_bo_reserve (bo, interruptible, false, false,0 ); + ret =ttm_bo_reserve (bo, interruptible, false, false,NULL );if (unlikely (ret !=0 )) goto err;@@ -105,7 +105,7 @@ int vmw_dmabuf_to_vram_or_gmr(struct vmw_private *dev_priv,if (pin)vmw_execbuf_release_pinned_bo (dev_priv); - ret =ttm_bo_reserve (bo, interruptible, false, false,0 ); + ret =ttm_bo_reserve (bo, interruptible, false, false,NULL );if (unlikely (ret !=0 )) goto err;@@ -212,7 +212,7 @@ int vmw_dmabuf_to_start_of_vram(struct vmw_private *dev_priv,if (pin)vmw_execbuf_release_pinned_bo (dev_priv); - ret =ttm_bo_reserve (bo, interruptible, false, false,0 ); + ret =ttm_bo_reserve (bo, interruptible, false, false,NULL );if (unlikely (ret !=0 )) goto err_unlock;drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1
-1@@ -316,7 +316,7 @@ static int vmw_dummy_query_bo_create(struct vmw_private *dev_priv)if (unlikely (ret !=0 ))return ret; - ret =ttm_bo_reserve (bo, false, true, false,0 ); + ret =ttm_bo_reserve (bo, false, true, false,NULL );BUG_ON (ret !=0 ); ret =ttm_bo_kmap (bo,0 ,1 , &map);drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +2
-2@@ -136,7 +136,7 @@ int vmw_cursor_update_dmabuf(struct vmw_private *dev_priv, kmap_offset =0 ; kmap_num = (width*height*4 +PAGE_SIZE -1 ) >>PAGE_SHIFT ; - ret =ttm_bo_reserve (&dmabuf->base, true, false, false,0 ); + ret =ttm_bo_reserve (&dmabuf->base, true, false, false,NULL );if (unlikely (ret !=0 )) {DRM_ERROR ("reserve failed\n" );return -EINVAL ;@@ -343,7 +343,7 @@ void vmw_kms_cursor_snoop(struct vmw_surface *srf, kmap_offset = cmd->dma.guest.ptr.offset >>PAGE_SHIFT ; kmap_num = (64 *64 *4 ) >>PAGE_SHIFT ; - ret =ttm_bo_reserve (bo, true, false, false,0 ); + ret =ttm_bo_reserve (bo, true, false, false,NULL );if (unlikely (ret !=0 )) {DRM_ERROR ("reserve failed\n" );return ;drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +1
-2@@ -127,7 +127,7 @@ static void vmw_resource_release(struct kref *kref)if (res->backup) {struct ttm_buffer_object *bo = &res->backup->base; -ttm_bo_reserve (bo, false, false, false,0 ); +ttm_bo_reserve (bo, false, false, false,NULL );if (!list_empty (&res->mob_head) && res->func->unbind !=NULL ) {struct ttm_validate_buffer val_buf; --2.0.1
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel