* [PATCH 1/2] drm/vmwgfx: make vmw_kms_helper_dirty return an initialized value
@ 2015-09-20 13:50 Nicolas Iooss
2015-09-20 13:50 ` [PATCH 2/2] drm/vmwgfx: make vmw_cotable_unbind " Nicolas Iooss
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Iooss @ 2015-09-20 13:50 UTC (permalink / raw)
To: David Airlie, Thomas Hellstrom, dri-devel; +Cc: linux-kernel, Nicolas Iooss
In vmw_kms_helper_dirty(), local variable ret is never initialized
before begin used in a return statement when vmw_fifo_reserve() fails.
Instead of returning an uninitialized value, return -ENOMEM here and
remove the useless variable.
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
---
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index 61fb7f3de311..15a6c01cd016 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -1685,7 +1685,6 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv,
struct drm_crtc *crtc;
u32 num_units = 0;
u32 i, k;
- int ret;
dirty->dev_priv = dev_priv;
@@ -1711,7 +1710,7 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv,
if (!dirty->cmd) {
DRM_ERROR("Couldn't reserve fifo space "
"for dirty blits.\n");
- return ret;
+ return -ENOMEM;
}
memset(dirty->cmd, 0, dirty->fifo_reserve_size);
}
--
2.5.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/2] drm/vmwgfx: make vmw_cotable_unbind return an initialized value
2015-09-20 13:50 [PATCH 1/2] drm/vmwgfx: make vmw_kms_helper_dirty return an initialized value Nicolas Iooss
@ 2015-09-20 13:50 ` Nicolas Iooss
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Iooss @ 2015-09-20 13:50 UTC (permalink / raw)
To: David Airlie, Thomas Hellstrom, dri-devel; +Cc: linux-kernel, Nicolas Iooss
In vmw_cotable_unbind(), local variable ret is never initialized before
being used in a return statement at the end of the function. Fix this
by directly returning zero and removing the variable.
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
---
drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
index ce659a125f2b..092ea81eeff7 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
@@ -311,7 +311,6 @@ static int vmw_cotable_unbind(struct vmw_resource *res,
struct vmw_private *dev_priv = res->dev_priv;
struct ttm_buffer_object *bo = val_buf->bo;
struct vmw_fence_obj *fence;
- int ret;
if (list_empty(&res->mob_head))
return 0;
@@ -328,7 +327,7 @@ static int vmw_cotable_unbind(struct vmw_resource *res,
if (likely(fence != NULL))
vmw_fence_obj_unreference(&fence);
- return ret;
+ return 0;
}
/**
--
2.5.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-20 13:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-20 13:50 [PATCH 1/2] drm/vmwgfx: make vmw_kms_helper_dirty return an initialized value Nicolas Iooss
2015-09-20 13:50 ` [PATCH 2/2] drm/vmwgfx: make vmw_cotable_unbind " Nicolas Iooss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®