diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2010-11-16 09:21:08 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-11-21 22:25:14 -0500 |
commit | 2357cbe5f4ca8a52329c2c2a26b68839870d5d43 (patch) | |
tree | 02bb29fd294a6855018814d0ce4e6f659f4ef5a5 /drivers/gpu/drm/ttm | |
parent | ecf7ace9a8450303a987aa8364e53860cd50e554 (diff) |
drm/ttm: Use kref_sub instead of repeatedly calling kref_put
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index a586378b1b2b..9ef893d5da88 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -266,10 +266,8 @@ static void ttm_bo_ref_bug(struct kref *list_kref) | |||
266 | void ttm_bo_list_ref_sub(struct ttm_buffer_object *bo, int count, | 266 | void ttm_bo_list_ref_sub(struct ttm_buffer_object *bo, int count, |
267 | bool never_free) | 267 | bool never_free) |
268 | { | 268 | { |
269 | while (count--) | 269 | kref_sub(&bo->list_kref, count, |
270 | kref_put(&bo->list_kref, | 270 | (never_free) ? ttm_bo_ref_bug : ttm_bo_release_list); |
271 | (never_free || (count >= 0)) ? ttm_bo_ref_bug : | ||
272 | ttm_bo_release_list); | ||
273 | } | 271 | } |
274 | 272 | ||
275 | int ttm_bo_reserve(struct ttm_buffer_object *bo, | 273 | int ttm_bo_reserve(struct ttm_buffer_object *bo, |