From patchwork Mon Jul 18 17:49:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 72233 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp213914qga; Mon, 18 Jul 2016 10:02:47 -0700 (PDT) X-Received: by 10.129.158.193 with SMTP id v184mr23503536ywg.278.1468861367001; Mon, 18 Jul 2016 10:02:47 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id s86si10911817qks.197.2016.07.18.10.02.46; Mon, 18 Jul 2016 10:02:46 -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 036E861DF7; Mon, 18 Jul 2016 17:02:31 +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 5E7F6687EF; Mon, 18 Jul 2016 16:52:13 +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 9F483687F6; Mon, 18 Jul 2016 16:52:04 +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 BE3DA687F3 for ; Mon, 18 Jul 2016 16:50:55 +0000 (UTC) Received: by mail-lf0-f49.google.com with SMTP id l69so79252761lfg.1 for ; Mon, 18 Jul 2016 09:50:55 -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=G9Gnzg3imkoj6PRoYXpjxBS/UC0RiWxl5jLkxVW3x3U8AKBTwZNRZKwf35BMuaK+ku YV1UXlxIzRsXc9MNr5LyJVxXEcudrJFpMNeHKJ217Zznkt2r2kLSvfDZ1jYc5AMYEbNq 7ayCGLzB0caKgl7F08yeebhn0Utw5vaIEH0V4sj2imgD3VH6NwGzlSU68McjXT/+MuZM EtfIO9+ew9F1PjTs9QhrB/g6AMwjpKl9abVC5jGTbpdPKYQw40tts7OMEyWVEpMQoMVE ZARmPTruus8tZVIotqJttMnUPeYGd79Ji1STR8tVg6oySPjrNT24a+nlHJJRPQv4k5yv m0nw== X-Gm-Message-State: ALyK8tIFSvJVlR2j1lXfr1bZ4OqY3GUehd/tMrLFVdXWKX0OWa7P+pJG8dQYQfF8LG5aIRCdJ0c= X-Received: by 10.25.161.76 with SMTP id k73mr10339421lfe.26.1468860654571; Mon, 18 Jul 2016 09:50:54 -0700 (PDT) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id y200sm2226229lfd.12.2016.07.18.09.50.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jul 2016 09:50:54 -0700 (PDT) From: Christophe Milard To: mike.holmes@linaro.org, yi.he@linaro.org, balakrishna.garapati@linaro.org, lng-odp@lists.linaro.org Date: Mon, 18 Jul 2016 19:49:36 +0200 Message-Id: <1468864178-43721-17-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468864178-43721-1-git-send-email-christophe.milard@linaro.org> References: <1468864178-43721-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH 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;