diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2010-11-16 15:21:08 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-11-22 13:25:14 +1000 |
commit | 2357cbe5f4ca8a52329c2c2a26b68839870d5d43 (patch) | |
tree | 02bb29fd294a6855018814d0ce4e6f659f4ef5a5 /drivers/gpu/drm/ttm | |
parent | ecf7ace9a8450303a987aa8364e53860cd50e554 (diff) | |
download | blackbird-op-linux-2357cbe5f4ca8a52329c2c2a26b68839870d5d43.tar.gz blackbird-op-linux-2357cbe5f4ca8a52329c2c2a26b68839870d5d43.zip |
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) void ttm_bo_list_ref_sub(struct ttm_buffer_object *bo, int count, bool never_free) { - while (count--) - kref_put(&bo->list_kref, - (never_free || (count >= 0)) ? ttm_bo_ref_bug : - ttm_bo_release_list); + kref_sub(&bo->list_kref, count, + (never_free) ? ttm_bo_ref_bug : ttm_bo_release_list); } int ttm_bo_reserve(struct ttm_buffer_object *bo, |