From patchwork Thu Jan 29 10:40:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 43914 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D1BE424119 for ; Thu, 29 Jan 2015 10:41:46 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id u10sf18119362lbd.3 for ; Thu, 29 Jan 2015 02:41:45 -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=yHXSoIFYVUjtV2aWj1avWYA1CI/4gABefKnH8rl2eFE=; b=R3qKNBSLb4E9VllXVB+DIlwubMqkWGqmz30cjW4NwaU1NxfpVwlZ1R+aQiV/6vsOsi dnVn0rl5QFTzb6/+/5YWDsFu17ZqJE1j7fbtf2DHbiVlx7HZlQqAT/NgQ+Vk0x6bSI1v XmbBmXBxzO69vln9ErAa+8D9hqIUFpn4qu1IrM8YcLmY8xAXbfE1IUGe2AEeiXGn+VRP UE0VPTEtg7xdrlMPQhsE+oH20jPPnOf8r7BUntKEbQm8B7FLlorBVDTDzAaiAsNWP3eI cws/lQEHiv3/HZc1U2DBT5yvehI48x30OpsyPQ6CF6qTg34gTgQtv3/dScFkmJzQSZEb n09g== X-Gm-Message-State: ALoCoQnky6y/Gj3BwBnJlFBldbDpLlrIHFmwfjGNB4N1Tfshdm9dKRwuiQghGXcvszVxVM6aW6L2 X-Received: by 10.152.2.40 with SMTP id 8mr1653562lar.7.1422528105849; Thu, 29 Jan 2015 02:41:45 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.71 with SMTP id k7ls291017laf.9.gmail; Thu, 29 Jan 2015 02:41:45 -0800 (PST) X-Received: by 10.112.57.226 with SMTP id l2mr13377389lbq.27.1422528105709; Thu, 29 Jan 2015 02:41:45 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id pl3si7046814lac.8.2015.01.29.02.41.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 02:41:45 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id z12so26518857lbi.7 for ; Thu, 29 Jan 2015 02:41:45 -0800 (PST) X-Received: by 10.152.182.235 with SMTP id eh11mr12931130lac.9.1422528105623; Thu, 29 Jan 2015 02:41:45 -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 h5csp1719660lbj; Thu, 29 Jan 2015 02:41:44 -0800 (PST) X-Received: by 10.224.54.2 with SMTP id o2mr32345qag.63.1422528104318; Thu, 29 Jan 2015 02:41:44 -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 h8si9702471qah.84.2015.01.29.02.41.42 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Jan 2015 02:41:44 -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 1YGmXd-0007SY-I4; Thu, 29 Jan 2015 10:41:41 +0000 Received: from mail-lb0-f171.google.com ([209.85.217.171]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YGmWT-0007JU-Jy for lng-odp@lists.linaro.org; Thu, 29 Jan 2015 10:40:29 +0000 Received: by mail-lb0-f171.google.com with SMTP id u14so26467548lbd.2 for ; Thu, 29 Jan 2015 02:40:24 -0800 (PST) X-Received: by 10.112.52.229 with SMTP id w5mr13431389lbo.52.1422528024094; Thu, 29 Jan 2015 02:40:24 -0800 (PST) Received: from macmini.lan (78-82-118-111.tn.glocalnet.net. [78.82.118.111]) by mx.google.com with ESMTPSA id y11sm2037670lba.5.2015.01.29.02.40.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 02:40:23 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Thu, 29 Jan 2015 11:40:05 +0100 Message-Id: <1422528008-29845-14-git-send-email-ola.liljedahl@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422528008-29845-1-git-send-email-ola.liljedahl@linaro.org> References: <1422528008-29845-1-git-send-email-ola.liljedahl@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 13/16] 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.217.176 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) platform/linux-generic/include/api/odp_shared_memory.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/platform/linux-generic/include/api/odp_shared_memory.h b/platform/linux-generic/include/api/odp_shared_memory.h index f70db5a..9801726 100644 --- a/platform/linux-generic/include/api/odp_shared_memory.h +++ b/platform/linux-generic/include/api/odp_shared_memory.h @@ -59,7 +59,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); @@ -72,9 +73,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); @@ -84,7 +84,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); @@ -94,18 +94,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);