From patchwork Tue Feb 3 14:53:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 44242 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 893332034D for ; Tue, 3 Feb 2015 14:55:15 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id s18sf21261995lam.2 for ; Tue, 03 Feb 2015 06:55:14 -0800 (PST) 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:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=/4C+smibiepE6UC8HDlULsrw7P9SKbBBi11lyFojfSI=; b=Pvo09hoYXtsy1jgFGzTibwLCciRgGkFuIRkI/l46uSv19t9GyoUXdy4egUfJ5C0XXf XLHlK2wXMYBsuL0VxLPHWVrm4YSNL5cYj4+oSaspaUkvVrGE/gfgPpefP0wWWeo7molM mQYpwTVz9e6gE0iqMqdMGUH00ssdAbqNwDvJU+aEHK48pmlx/sbyu8L5F7xXRxAviRFA aaPdq1NgVMw2eMh72pKpZv74k59+wIhxmVw63GLwURaXRxadueoRGgF1fQT0GwPO0/Gn HL6e22Q3Mokrco78PUfAOsuldvHq8NUwgA2YUfXueXsArsjnjign9iXhbZlkwuzJ0Uuq +ULg== X-Gm-Message-State: ALoCoQmRr8RW87MSj/80PPTBCMBQSMXmwM9+S4Gdhtxth7G+ImLeeBJDqn4cLnVIF6/FM8+KIorE X-Received: by 10.194.142.174 with SMTP id rx14mr3180832wjb.4.1422975314468; Tue, 03 Feb 2015 06:55:14 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.102 with SMTP id ud6ls220326lac.26.gmail; Tue, 03 Feb 2015 06:55:14 -0800 (PST) X-Received: by 10.112.147.137 with SMTP id tk9mr6006783lbb.39.1422975314306; Tue, 03 Feb 2015 06:55:14 -0800 (PST) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id qr3si8909811lbb.127.2015.02.03.06.55.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 06:55:14 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id hv19so52315438lab.13 for ; Tue, 03 Feb 2015 06:55:14 -0800 (PST) X-Received: by 10.152.44.228 with SMTP id h4mr19211769lam.31.1422975314198; Tue, 03 Feb 2015 06:55:14 -0800 (PST) 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.112.35.133 with SMTP id h5csp1988407lbj; Tue, 3 Feb 2015 06:55:13 -0800 (PST) X-Received: by 10.140.81.74 with SMTP id e68mr47038484qgd.41.1422975312482; Tue, 03 Feb 2015 06:55:12 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id l10si29023227qgf.74.2015.02.03.06.55.08 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Feb 2015 06:55:12 -0800 (PST) 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-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YIesd-0001mz-4N; Tue, 03 Feb 2015 14:55:07 +0000 Received: from mail-la0-f42.google.com ([209.85.215.42]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YIerL-0001Yu-7W for lng-odp@lists.linaro.org; Tue, 03 Feb 2015 14:53:47 +0000 Received: by mail-la0-f42.google.com with SMTP id ms9so52484728lab.1 for ; Tue, 03 Feb 2015 06:53:41 -0800 (PST) X-Received: by 10.112.118.144 with SMTP id km16mr24970433lbb.75.1422975221619; Tue, 03 Feb 2015 06:53:41 -0800 (PST) Received: from localhost.localdomain (78-82-118-111.tn.glocalnet.net. [78.82.118.111]) by mx.google.com with ESMTPSA id jf3sm5082572lbc.44.2015.02.03.06.53.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Feb 2015 06:53:41 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Tue, 3 Feb 2015 15:53:17 +0100 Message-Id: <1422975201-3364-15-git-send-email-ola.liljedahl@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422975201-3364-1-git-send-email-ola.liljedahl@linaro.org> References: <1422975201-3364-1-git-send-email-ola.liljedahl@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv4 14/18] api: odp_shared_memory.h: updated return descriptions 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: ola.liljedahl@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.215.54 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 Updated doxygen descriptions, particularly the @return/@retval descriptions. No change of implementation necessary. Documented API calls which are guaranteed to handle invalid/stale handles. Signed-off-by: Ola Liljedahl --- (This document/code contribution attached is provided under the terms of agreement LES-LTM-21309) include/odp/api/shared_memory.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/odp/api/shared_memory.h b/include/odp/api/shared_memory.h index 5b27b6b..18764ce 100644 --- a/include/odp/api/shared_memory.h +++ b/include/odp/api/shared_memory.h @@ -71,7 +71,8 @@ typedef struct odp_shm_info_t { * @param[in] flags Shared memory parameter flags (ODP_SHM_*). * Default value is 0. * - * @return Pointer to the reserved block, or NULL + * @return Handle of the reserved block + * @retval NULL on failure */ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, uint32_t flags); @@ -84,9 +85,8 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, * * @param[in] shm Block handle * - * @retval 0 if the handle is already free - * @retval 0 if the handle free succeeds - * @retval -1 on failure to free the handle + * @retval 0 on success + * @retval <0 on failure to free the handle */ int odp_shm_free(odp_shm_t shm); @@ -96,7 +96,7 @@ int odp_shm_free(odp_shm_t shm); * @param[in] name Name of the block * * @return A handle to the block if it is found by name - * @retval #ODP_SHM_INVALID if the block is not found + * @retval ODP_SHM_INVALID on failure */ odp_shm_t odp_shm_lookup(const char *name); @@ -106,18 +106,21 @@ odp_shm_t odp_shm_lookup(const char *name); * * @param[in] shm Block handle * - * @return Memory block address, or NULL on error + * @return Memory block address */ void *odp_shm_addr(odp_shm_t shm); /** * Shared memory block info + * @note This is the only shared memory API function which accepts invalid + * shm handles (any bit value) without causing undefined behavior. * * @param[in] shm Block handle * @param[out] info Block info pointer for output * - * @return 0 on success, otherwise non-zero + * @retval 0 on success + * @retval <0 on failure */ int odp_shm_info(odp_shm_t shm, odp_shm_info_t *info);