From patchwork Mon Jan 30 18:40:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 9546313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 57B6C60417 for ; Tue, 31 Jan 2017 01:05:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4969420499 for ; Tue, 31 Jan 2017 01:05:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E42F271FD; Tue, 31 Jan 2017 01:05:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CAD8120499 for ; Tue, 31 Jan 2017 01:05:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A9BFD6E5D4; Tue, 31 Jan 2017 01:05:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailrelay112.isp.belgacom.be (mailrelay112.isp.belgacom.be [195.238.20.139]) by gabe.freedesktop.org (Postfix) with ESMTPS id D1B366E1C2 for ; Mon, 30 Jan 2017 18:40:05 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2ATAwAniI9Y/+M5QFddHQEXAQYBgl1pQ?= =?us-ascii?q?YEpjlCROwGQNYJEgg+CDIYcBAKCJEAYAQIBAQEBAQEBYiiFFy8jKXEkE4lUEa0?= =?us-ascii?q?cOoQQhzWGS4kIhhUFm1SRbg2Qd0iSNx84gS4aGIQoAQuCQT81hXaCPAEBAQ?= X-IPAS-Result: =?us-ascii?q?A2ATAwAniI9Y/+M5QFddHQEXAQYBgl1pQYEpjlCROwGQNYJ?= =?us-ascii?q?Egg+CDIYcBAKCJEAYAQIBAQEBAQEBYiiFFy8jKXEkE4lUEa0cOoQQhzWGS4kIh?= =?us-ascii?q?hUFm1SRbg2Qd0iSNx84gS4aGIQoAQuCQT81hXaCPAEBAQ?= Received: from 227.57-64-87.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([87.64.57.227]) by relay.skynet.be with ESMTP; 30 Jan 2017 19:40:03 +0100 From: Fabian Frederick To: Andrew Morton Subject: [PATCH 03/14] drm/omap: use atomic_dec_not_zero() Date: Mon, 30 Jan 2017 19:40:00 +0100 Message-Id: <20170130184000.12980-1-fabf@skynet.be> X-Mailer: git-send-email 2.9.3 X-Mailman-Approved-At: Tue, 31 Jan 2017 01:04:44 +0000 Cc: Fabian Frederick , Tomi Valkeinen , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP instead of atomic_add_unless(value, -1, 0) Signed-off-by: Fabian Frederick --- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c index 3cab066..abd0b15 100644 --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c @@ -184,7 +184,7 @@ static struct dmm_txn *dmm_txn_init(struct dmm *dmm, struct tcm *tcm) /* wait until an engine is available */ ret = wait_event_interruptible(omap_dmm->engine_queue, - atomic_add_unless(&omap_dmm->engine_counter, -1, 0)); + atomic_dec_not_zero(&omap_dmm->engine_counter)); if (ret) return ERR_PTR(ret);