From patchwork Sat Apr 2 15:54:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 8731861 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 76A049F36E for ; Sat, 2 Apr 2016 15:55:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F18020379 for ; Sat, 2 Apr 2016 15:55:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6489E2034E for ; Sat, 2 Apr 2016 15:55:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751281AbcDBPzv (ORCPT ); Sat, 2 Apr 2016 11:55:51 -0400 Received: from mail-ig0-f193.google.com ([209.85.213.193]:34677 "EHLO mail-ig0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751219AbcDBPzu (ORCPT ); Sat, 2 Apr 2016 11:55:50 -0400 Received: by mail-ig0-f193.google.com with SMTP id mh10so4946838igb.1; Sat, 02 Apr 2016 08:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=pPdD0KEWQnlJWvkRhI+Hgoneh1rN5KNl3XREeztloLs=; b=HGi5C1iPzWxmq4zguVRnlId6+2/Fl+jJNyCLUxURfimJK8HJGFEwNGm0kJyYrNiKq4 yaTUMcplwOhhPBhmSKlcYaBGjNuEunCq9DD3Hj+SPMkd6TRjImFrs0YWrcxB58iolSOG VOEWJSveA+lU4yu1lMPj/8mngJCnq6C5DR/SsLh6Ib3Z6gyqdbpqyLc+zeFzS6bAVNi6 3xIISHaxT9ZzZhg92w8E2uS2+rY916gFNh1OO9RVP+GKdweiJp+h+SzRKmD/8WIX4QJ0 ToUuBpHrc67eYuLAXUZnP/47BGV0yjPJNOsLr3PH3eXql5dWxnaNCuTIqZneNlIx0IYl Uvvw== 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; bh=pPdD0KEWQnlJWvkRhI+Hgoneh1rN5KNl3XREeztloLs=; b=KNq6YF5bIuUmneXS6uVDrqdHfgyhH+s19UfTb/KP4e74C3n99lTRKtH60Ve2ppueAr 3OGslUvjUDIBgmd5WS4VkBpAGMfErpy2L4ea5DpJCniPvsjieoK6o9hrF5dVlyA12sYC Ij5u40XFaIORyFZISfd7twXSu1OO6T4VqY4fKoCaSmy+Dntn1ArtQeM7srK9Ht+6NLvR qVA0bIK6QHxfkZyDTZ/BV/CDPRdD23oeH8zOnbuGu5KdBjp9L3btSzCASiCX4Tn3DAN2 ws4fKvEdrFNV+TI+PVDIOZuvssvYaTpH/oCqa4NJBhSDHsPS+KfhQSJQNtT9yjkAUl7j UheQ== X-Gm-Message-State: AD7BkJIDDPLnIlG0YIntUK+Uni013Tsx36YzjN/79XMWkhloBUfDRVvfo16gKdpLMadIXQ== X-Received: by 10.107.161.68 with SMTP id k65mr11570807ioe.110.1459612549888; Sat, 02 Apr 2016 08:55:49 -0700 (PDT) Received: from localhost.localdomain (c-24-7-245-123.hsd1.mn.comcast.net. [24.7.245.123]) by smtp.gmail.com with ESMTPSA id vs2sm1804761igb.20.2016.04.02.08.55.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 02 Apr 2016 08:55:49 -0700 (PDT) From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, davem@davemloft.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Biggers Subject: [PATCH] crypto: document correct return value for request allocation Date: Sat, 2 Apr 2016 10:54:56 -0500 Message-Id: <1459612496-5094-1-git-send-email-ebiggers3@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Eric Biggers --- Documentation/DocBook/crypto-API.tmpl | 6 +++--- include/crypto/aead.h | 3 +-- include/crypto/hash.h | 3 +-- include/crypto/skcipher.h | 3 +-- include/linux/crypto.h | 3 +-- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Documentation/DocBook/crypto-API.tmpl b/Documentation/DocBook/crypto-API.tmpl index 348619f..d55dc5a 100644 --- a/Documentation/DocBook/crypto-API.tmpl +++ b/Documentation/DocBook/crypto-API.tmpl @@ -1936,9 +1936,9 @@ static int test_skcipher(void) } req = skcipher_request_alloc(skcipher, GFP_KERNEL); - if (IS_ERR(req)) { - pr_info("could not allocate request queue\n"); - ret = PTR_ERR(req); + if (!req) { + pr_info("could not allocate skcipher request\n"); + ret = -ENOMEM; goto out; } diff --git a/include/crypto/aead.h b/include/crypto/aead.h index 957bb87..75174f8 100644 --- a/include/crypto/aead.h +++ b/include/crypto/aead.h @@ -405,8 +405,7 @@ static inline void aead_request_set_tfm(struct aead_request *req, * encrypt and decrypt API calls. During the allocation, the provided aead * handle is registered in the request data structure. * - * Return: allocated request handle in case of success; IS_ERR() is true in case - * of an error, PTR_ERR() returns the error code. + * Return: allocated request handle in case of success, or NULL if out of memory */ static inline struct aead_request *aead_request_alloc(struct crypto_aead *tfm, gfp_t gfp) diff --git a/include/crypto/hash.h b/include/crypto/hash.h index 1969f14..2660588 100644 --- a/include/crypto/hash.h +++ b/include/crypto/hash.h @@ -547,8 +547,7 @@ static inline void ahash_request_set_tfm(struct ahash_request *req, * the allocation, the provided ahash handle * is registered in the request data structure. * - * Return: allocated request handle in case of success; IS_ERR() is true in case - * of an error, PTR_ERR() returns the error code. + * Return: allocated request handle in case of success, or NULL if out of memory */ static inline struct ahash_request *ahash_request_alloc( struct crypto_ahash *tfm, gfp_t gfp) diff --git a/include/crypto/skcipher.h b/include/crypto/skcipher.h index 905490c..0f987f5 100644 --- a/include/crypto/skcipher.h +++ b/include/crypto/skcipher.h @@ -425,8 +425,7 @@ static inline struct skcipher_request *skcipher_request_cast( * encrypt and decrypt API calls. During the allocation, the provided skcipher * handle is registered in the request data structure. * - * Return: allocated request handle in case of success; IS_ERR() is true in case - * of an error, PTR_ERR() returns the error code. + * Return: allocated request handle in case of success, or NULL if out of memory */ static inline struct skcipher_request *skcipher_request_alloc( struct crypto_skcipher *tfm, gfp_t gfp) diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 99c9489..6e28c89 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -948,8 +948,7 @@ static inline struct ablkcipher_request *ablkcipher_request_cast( * encrypt and decrypt API calls. During the allocation, the provided ablkcipher * handle is registered in the request data structure. * - * Return: allocated request handle in case of success; IS_ERR() is true in case - * of an error, PTR_ERR() returns the error code. + * Return: allocated request handle in case of success, or NULL if out of memory */ static inline struct ablkcipher_request *ablkcipher_request_alloc( struct crypto_ablkcipher *tfm, gfp_t gfp)