All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] i915: fix impossible BUG_ON() test
@ 2010-10-27 21:25 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2010-10-27 21:25 UTC (permalink / raw)
  To: Chris Wilson; +Cc: kernel-janitors, dri-devel

obj_priv->pin_count is unsigned so the BUG_ON(obj_priv->pin_count < 0)
will never trigger.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 8eb8453..151d9c8 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4082,10 +4082,11 @@ i915_gem_object_unpin(struct drm_gem_object *obj)
 	struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
 
 	WARN_ON(i915_verify_lists(dev));
-	obj_priv->pin_count--;
-	BUG_ON(obj_priv->pin_count < 0);
+	BUG_ON(obj_priv->pin_count = 0);
 	BUG_ON(obj_priv->gtt_space = NULL);
 
+	obj_priv->pin_count--;
+
 	/* If the object is no longer pinned, and is
 	 * neither active nor being flushed, then stick it on
 	 * the inactive list

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch] i915: fix impossible BUG_ON() test
@ 2010-10-27 21:25 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2010-10-27 21:25 UTC (permalink / raw)
  To: Chris Wilson; +Cc: kernel-janitors, dri-devel

obj_priv->pin_count is unsigned so the BUG_ON(obj_priv->pin_count < 0)
will never trigger.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 8eb8453..151d9c8 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4082,10 +4082,11 @@ i915_gem_object_unpin(struct drm_gem_object *obj)
 	struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
 
 	WARN_ON(i915_verify_lists(dev));
-	obj_priv->pin_count--;
-	BUG_ON(obj_priv->pin_count < 0);
+	BUG_ON(obj_priv->pin_count == 0);
 	BUG_ON(obj_priv->gtt_space == NULL);
 
+	obj_priv->pin_count--;
+
 	/* If the object is no longer pinned, and is
 	 * neither active nor being flushed, then stick it on
 	 * the inactive list

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] i915: fix impossible BUG_ON() test
  2010-10-27 21:25 ` Dan Carpenter
@ 2010-10-27 21:30   ` Chris Wilson
  -1 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2010-10-27 21:30 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: kernel-janitors, dri-devel

On Wed, 27 Oct 2010 23:25:34 +0200, Dan Carpenter <error27@gmail.com> wrote:
> obj_priv->pin_count is unsigned so the BUG_ON(obj_priv->pin_count < 0)
> will never trigger.

I have the same change pending, but not queued for -fixes since it is
impossible.

Thanks,
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] i915: fix impossible BUG_ON() test
@ 2010-10-27 21:30   ` Chris Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2010-10-27 21:30 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: kernel-janitors, dri-devel

On Wed, 27 Oct 2010 23:25:34 +0200, Dan Carpenter <error27@gmail.com> wrote:
> obj_priv->pin_count is unsigned so the BUG_ON(obj_priv->pin_count < 0)
> will never trigger.

I have the same change pending, but not queued for -fixes since it is
impossible.

Thanks,
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-27 21:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-27 21:25 [patch] i915: fix impossible BUG_ON() test Dan Carpenter
2010-10-27 21:25 ` Dan Carpenter
2010-10-27 21:30 ` Chris Wilson
2010-10-27 21:30   ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.