From patchwork Sat Oct 9 12:36:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Delvare X-Patchwork-Id: 243371 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o99Cb3kK025087 for ; Sat, 9 Oct 2010 12:37:28 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 421E19E95A for ; Sat, 9 Oct 2010 05:37:01 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from services.gcu-squad.org (zone0.gcu-squad.org [212.85.147.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 2A5DC9E798 for ; Sat, 9 Oct 2010 05:36:54 -0700 (PDT) Received: from jdelvare.pck.nerim.net ([62.212.121.182] helo=endymion.delvare) by services.gcu-squad.org (GCU Mailer Daemon) with esmtpsa id 1P4Yfc-0003W9-Ez (TLSv1:AES128-SHA:128) (envelope-from ) ; Sat, 09 Oct 2010 14:37:00 +0200 Date: Sat, 9 Oct 2010 14:36:45 +0200 From: Jean Delvare To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/ttm: Simplify ttm_bo_wait_unreserved Message-ID: <20101009143645.1f14b266@endymion.delvare> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.20.1; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Cc: Thomas Hellstrom , Jerome Glisse X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 09 Oct 2010 12:37:28 +0000 (UTC) --- linux-2.6.36-rc7.orig/drivers/gpu/drm/ttm/ttm_bo.c 2010-10-09 13:38:39.000000000 +0200 +++ linux-2.6.36-rc7/drivers/gpu/drm/ttm/ttm_bo.c 2010-10-09 14:23:07.000000000 +0200 @@ -169,18 +169,13 @@ static void ttm_bo_release_list(struct k int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, bool interruptible) { - if (interruptible) { - int ret = 0; - - ret = wait_event_interruptible(bo->event_queue, + return wait_event_interruptible(bo->event_queue, atomic_read(&bo->reserved) == 0); - if (unlikely(ret != 0)) - return ret; } else { wait_event(bo->event_queue, atomic_read(&bo->reserved) == 0); + return 0; } - return 0; } EXPORT_SYMBOL(ttm_bo_wait_unreserved);