From patchwork Tue Jul 8 16:48:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 33242 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9427120969 for ; Tue, 8 Jul 2014 16:49:05 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kq14sf43332403pab.0 for ; Tue, 08 Jul 2014 09:49:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=UpeTRJ8fMSfQ6FISnWa84NYP3luC+ECbOZxMnu1veZA=; b=gy8fRwwv0yvmyFV5VdgK8+Za/saT6H08bnapYnPzKHbs6sW0CzfXI3zn+htf7u8O/U a3KrHOpwlBS3sId4nIqOxpeQhHz2SFEn7bb3ckGeoTgGHu3eEK/C9zrWtijDM15Sxdez 0w3sEnkwd7GHa3NNTYqqjwksac2zBXSgBPUt6A5Yvtz2KbPGOKD2AlrTFSt/68xhQk53 DDXetvGS0V64qn2a5eu8tGDZsEUb8mTz/pBv0WuEQkw3E+dDuc5k+g39cNl10x0JQQqF IV2AqUDOz5n2lelGKSbwCW+7H0Uf+VovEMj0rI34kEXujqvhMPz1hYf3avM4Tgpoxqco gmEA== X-Gm-Message-State: ALoCoQkzTbsn3jIhHh0ZK/9Sv1yna5DHeRuYYUOa1Hjhj1J1Qw+6nc+1xFYzOBIyUStOqRdYAq8P X-Received: by 10.68.137.99 with SMTP id qh3mr17759077pbb.2.1404838143670; Tue, 08 Jul 2014 09:49:03 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.107.198 with SMTP id h64ls2369136qgf.66.gmail; Tue, 08 Jul 2014 09:49:03 -0700 (PDT) X-Received: by 10.220.5.138 with SMTP id 10mr1202108vcv.67.1404838143547; Tue, 08 Jul 2014 09:49:03 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id r4si9470431vdr.12.2014.07.08.09.49.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Jul 2014 09:49:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jx11so5957923veb.19 for ; Tue, 08 Jul 2014 09:49:03 -0700 (PDT) X-Received: by 10.58.34.169 with SMTP id a9mr34609779vej.5.1404838143446; Tue, 08 Jul 2014 09:49:03 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp786871vcb; Tue, 8 Jul 2014 09:49:03 -0700 (PDT) X-Received: by 10.224.5.193 with SMTP id 1mr24840496qaw.89.1404838142977; Tue, 08 Jul 2014 09:49:02 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id t6si43928430qcs.8.2014.07.08.09.49.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 08 Jul 2014 09:49:02 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1X4YXX-0005pZ-GZ; Tue, 08 Jul 2014 16:46:47 +0000 Received: from mail-qg0-f52.google.com ([209.85.192.52]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1X4YXR-0005p1-Ud for lng-odp@lists.linaro.org; Tue, 08 Jul 2014 16:46:41 +0000 Received: by mail-qg0-f52.google.com with SMTP id f51so5346594qge.11 for ; Tue, 08 Jul 2014 09:48:51 -0700 (PDT) X-Received: by 10.224.129.68 with SMTP id n4mr60762038qas.66.1404838131204; Tue, 08 Jul 2014 09:48:51 -0700 (PDT) Received: from fedora1.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id p21sm29399399qgp.14.2014.07.08.09.48.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Jul 2014 09:48:50 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Tue, 8 Jul 2014 12:48:33 -0400 Message-Id: <1404838113-59583-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH V2] use bool for logical test functions X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Mike Holmes --- include/odp_buffer.h | 4 ++-- include/odp_coremask.h | 11 ++++++++--- include/odp_ticketlock.h | 4 ++-- platform/linux-generic/odp_buffer.c | 2 +- platform/linux-generic/odp_coremask.c | 2 +- platform/linux-generic/odp_ticketlock.c | 2 +- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/include/odp_buffer.h b/include/odp_buffer.h index d8577fd..c1c9bef 100644 --- a/include/odp_buffer.h +++ b/include/odp_buffer.h @@ -71,9 +71,9 @@ int odp_buffer_type(odp_buffer_t buf); * * @param buf Buffer handle * - * @return 1 if valid, otherwise 0 + * @return true if valid, otherwise false */ -int odp_buffer_is_valid(odp_buffer_t buf); +bool odp_buffer_is_valid(odp_buffer_t buf); /** * Print buffer metadata to STDOUT diff --git a/include/odp_coremask.h b/include/odp_coremask.h index 141cb6a..f5a9a0b 100644 --- a/include/odp_coremask.h +++ b/include/odp_coremask.h @@ -109,9 +109,9 @@ void odp_coremask_clr(int core, odp_coremask_t *mask); * Test if core is a member of mask * @param core Core number * @param mask Core mask to check if core num set or not - * @return non-zero if set otherwise 0 + * @return true if the core mask is set, otherwise false */ -int odp_coremask_isset(int core, const odp_coremask_t *mask); +bool odp_coremask_isset(int core, const odp_coremask_t *mask); /** * Count number of cores in mask @@ -163,8 +163,13 @@ static inline void odp_coremask_xor(odp_coremask_t *dest, odp_coremask_t *src1, /** * Test if two masks contain the same cores + * + * @param mask1 First mask to compare + * @param mask2 Second mask to compare + * + * @return true is they are equal or false otherwise */ -static inline int odp_coremask_equal(odp_coremask_t *mask1, +static inline bool odp_coremask_equal(odp_coremask_t *mask1, odp_coremask_t *mask2) { return (mask1->_u64[0] == mask2->_u64[0]); diff --git a/include/odp_ticketlock.h b/include/odp_ticketlock.h index 6277a18..2e61ef6 100644 --- a/include/odp_ticketlock.h +++ b/include/odp_ticketlock.h @@ -71,9 +71,9 @@ void odp_ticketlock_unlock(odp_ticketlock_t *ticketlock); * * @param ticketlock Ticketlock * - * @return 1 if the lock is locked, otherwise 0. + * @return true if the ticket lock is locked, otherwise false */ -int odp_ticketlock_is_locked(odp_ticketlock_t *ticketlock); +bool odp_ticketlock_is_locked(odp_ticketlock_t *ticketlock); #ifdef __cplusplus diff --git a/platform/linux-generic/odp_buffer.c b/platform/linux-generic/odp_buffer.c index 0169eec..41b6a4c 100644 --- a/platform/linux-generic/odp_buffer.c +++ b/platform/linux-generic/odp_buffer.c @@ -36,7 +36,7 @@ int odp_buffer_type(odp_buffer_t buf) } -int odp_buffer_is_valid(odp_buffer_t buf) +bool odp_buffer_is_valid(odp_buffer_t buf) { odp_buffer_bits_t handle; diff --git a/platform/linux-generic/odp_coremask.c b/platform/linux-generic/odp_coremask.c index c55eb72..c98a10a 100644 --- a/platform/linux-generic/odp_coremask.c +++ b/platform/linux-generic/odp_coremask.c @@ -81,7 +81,7 @@ void odp_coremask_clr(int core, odp_coremask_t *mask) } -int odp_coremask_isset(int core, const odp_coremask_t *mask) +bool odp_coremask_isset(int core, const odp_coremask_t *mask) { /* should not be more than 63 * core no. should be from 0..63= 64bit diff --git a/platform/linux-generic/odp_ticketlock.c b/platform/linux-generic/odp_ticketlock.c index be5b885..6cc5285 100644 --- a/platform/linux-generic/odp_ticketlock.c +++ b/platform/linux-generic/odp_ticketlock.c @@ -45,7 +45,7 @@ void odp_ticketlock_unlock(odp_ticketlock_t *ticketlock) } -int odp_ticketlock_is_locked(odp_ticketlock_t *ticketlock) +bool odp_ticketlock_is_locked(odp_ticketlock_t *ticketlock) { return ticketlock->cur_ticket != ticketlock->next_ticket; }