From patchwork Wed Jul 20 20:39:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 72512 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp79066qga; Wed, 20 Jul 2016 13:51:39 -0700 (PDT) X-Received: by 10.36.14.193 with SMTP id 184mr9112718ite.91.1469047899674; Wed, 20 Jul 2016 13:51:39 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c135si18466118itb.118.2016.07.20.13.51.38; Wed, 20 Jul 2016 13:51:39 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id BAB4F68434; Wed, 20 Jul 2016 20:51:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 9B30068911; Wed, 20 Jul 2016 20:41:23 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 0FF1268938; Wed, 20 Jul 2016 20:40:53 +0000 (UTC) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by lists.linaro.org (Postfix) with ESMTPS id 3828E688FB for ; Wed, 20 Jul 2016 20:39:25 +0000 (UTC) Received: by mail-lf0-f49.google.com with SMTP id f93so46378517lfi.2 for ; Wed, 20 Jul 2016 13:39:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kFSxdIL1JiDiYSvuYxA9pCuD0TVqD9xwPfU5NJPvAus=; b=gcfVmukx7J+FB4llFgbaZcMHp06HlMrh6T2wyovUrmxGFBvQf8agcRQSoQxyi9ovc2 gQRQ0hu8UOpu5tjwYp5Igcic/tK1YJ4dw9xg2VHYLx6kL46JYoSDMfvQFEutu6Q8koph fDMoqviJwOPdkhcpQ2bPielNbcZ1FSm3b1OiYx+6ASJG22A3fm3cLTApsSH7hkaQZxTZ cT76ujY4Zx2RB1vOgrUui2mnBm9ClbbFWxDXRSI4e7kP1clZQ+sMxH2RGENK+pGhX0eg 44b0Dvesurbxuf7VqyyOCfZZV+wq7IHqxzuTUxCFl9hYVtdy66V3GMq3X8O/jVB6K1Fh jNeQ== X-Gm-Message-State: ALyK8tJtL14D1zBC+hO2n10S1i+JQ0vYyB/SkqI55VhHkRYKxp4N52XjZdx+02widJ08o+CGe0c= X-Received: by 10.46.71.19 with SMTP id u19mr15564848lja.23.1469047164066; Wed, 20 Jul 2016 13:39:24 -0700 (PDT) Received: from localhost.localdomain (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id 29sm895112lfu.43.2016.07.20.13.39.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Jul 2016 13:39:23 -0700 (PDT) From: Christophe Milard To: mike.holmes@linaro.org, lng-odp@lists.linaro.org, balakrishna.garapati@linaro.org Date: Wed, 20 Jul 2016 22:39:02 +0200 Message-Id: <1469047144-7960-17-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1469047144-7960-1-git-send-email-christophe.milard@linaro.org> References: <1469047144-7960-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2 16/18] linux-generic: cosmetic changes on spinlock X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" To please check-patch before the copy to the drv interface. Signed-off-by: Christophe Milard --- include/odp/api/spec/spinlock.h | 7 ------- platform/linux-generic/odp_spinlock.c | 4 ---- 2 files changed, 11 deletions(-) -- 2.7.4 diff --git a/include/odp/api/spec/spinlock.h b/include/odp/api/spec/spinlock.h index 87f9b83..11b7339 100644 --- a/include/odp/api/spec/spinlock.h +++ b/include/odp/api/spec/spinlock.h @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-3-Clause */ - /** * @file * @@ -41,7 +40,6 @@ extern "C" { */ void odp_spinlock_init(odp_spinlock_t *splock); - /** * Acquire spin lock. * @@ -49,7 +47,6 @@ void odp_spinlock_init(odp_spinlock_t *splock); */ void odp_spinlock_lock(odp_spinlock_t *splock); - /** * Try to acquire spin lock. * @@ -60,7 +57,6 @@ void odp_spinlock_lock(odp_spinlock_t *splock); */ int odp_spinlock_trylock(odp_spinlock_t *splock); - /** * Release spin lock. * @@ -68,7 +64,6 @@ int odp_spinlock_trylock(odp_spinlock_t *splock); */ void odp_spinlock_unlock(odp_spinlock_t *splock); - /** * Check if spin lock is busy (locked). * @@ -79,8 +74,6 @@ void odp_spinlock_unlock(odp_spinlock_t *splock); */ int odp_spinlock_is_locked(odp_spinlock_t *splock); - - /** * @} */ diff --git a/platform/linux-generic/odp_spinlock.c b/platform/linux-generic/odp_spinlock.c index 6fc138b..cb0f053 100644 --- a/platform/linux-generic/odp_spinlock.c +++ b/platform/linux-generic/odp_spinlock.c @@ -13,7 +13,6 @@ void odp_spinlock_init(odp_spinlock_t *spinlock) _odp_atomic_flag_init(&spinlock->lock, 0); } - void odp_spinlock_lock(odp_spinlock_t *spinlock) { /* While the lock is already taken... */ @@ -25,19 +24,16 @@ void odp_spinlock_lock(odp_spinlock_t *spinlock) odp_cpu_pause(); } - int odp_spinlock_trylock(odp_spinlock_t *spinlock) { return (_odp_atomic_flag_tas(&spinlock->lock) == 0); } - void odp_spinlock_unlock(odp_spinlock_t *spinlock) { _odp_atomic_flag_clear(&spinlock->lock); } - int odp_spinlock_is_locked(odp_spinlock_t *spinlock) { return _odp_atomic_flag_load(&spinlock->lock) != 0;