From patchwork Tue Jan 26 12:25:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 8121111 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 4DC659F859 for ; Tue, 26 Jan 2016 12:27:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A42F20263 for ; Tue, 26 Jan 2016 12:27:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7BA0E2026C for ; Tue, 26 Jan 2016 12:27:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934074AbcAZM1S (ORCPT ); Tue, 26 Jan 2016 07:27:18 -0500 Received: from mail-pf0-f177.google.com ([209.85.192.177]:36334 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933947AbcAZM0c (ORCPT ); Tue, 26 Jan 2016 07:26:32 -0500 Received: by mail-pf0-f177.google.com with SMTP id n128so98445552pfn.3 for ; Tue, 26 Jan 2016 04:26:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=jpz5hgbkvWVWNorgAVbDXeBFHmPJJLt1N36FHND9Ry8=; b=H4CFAs1QPGIHRK3HKgQKRhNuf2hXB5Q7OMcyodxIuFbYTahN9cx4nSgl39H2urD7ZR kTc6N24cfD9L9ml6AJiIXcCKU/tyAc81eGDW97r5k75B1gsnsjVh1Z5BSyA0O07EWfZD rUeXayFUuZHhyShc6fnOrYSGdp3SIlO51TnPg= 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:in-reply-to:references; bh=jpz5hgbkvWVWNorgAVbDXeBFHmPJJLt1N36FHND9Ry8=; b=K9adBJxy+Vgi05QLncBkjR4gNXEKfGZsSZTxylbJxB6NIg6CWd7IY90ZETOJM9JxyV URApWE3FIoLnxPTuGvu9rIV6BkIzdUzIe75Oc9NaD9RTW3gk2U8u/LW1c0b8GNbfpUwy WNKFAy7DbK2F7K6cipNOtM8m4pLo+s3UESup+2Nr0i1/ZgJHp7k+q9j6VIv+Up1Mtio+ MgI9nBnrXjQ1ILNZggyjfY8czVWbbRIVkpSNBd9IjZyLdjdqHObkZneCvQD24Fagu99g JJZ77S6PR4VZo8Cyk/pquwUlUpLFcA4YJB1GwcVGbPlqfBxyVcwUh1mdzRrSMknNbn5b acgA== X-Gm-Message-State: AG10YORH6pxzLgZc9uuss86e9o4lIkIdLVfrYjkJQxDgdv/+8uLp9qkSqQ5i607aThWxSvOW X-Received: by 10.98.80.12 with SMTP id e12mr33058070pfb.62.1453811192052; Tue, 26 Jan 2016 04:26:32 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id r26sm1720088pfb.21.2016.01.26.04.26.29 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jan 2016 04:26:31 -0800 (PST) From: Baolin Wang To: herbert@gondor.apana.org.au, davem@davemloft.net Cc: broonie@kernel.org, linus.walleij@linaro.org, arnd@arndb.de, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, baolin.wang@linaro.org Subject: [PATCH 1/3] crypto: Introduce crypto_queue_len() helper function Date: Tue, 26 Jan 2016 20:25:38 +0800 Message-Id: <75865be3c2ff947df2fa422d37a7d404c320e15b.1453810716.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 This patch introduces crypto_queue_len() helper function to help to get the queue length in the crypto queue list now. Signed-off-by: Baolin Wang --- include/crypto/algapi.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index c9fe145..4f861c4 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h @@ -184,6 +184,10 @@ int crypto_enqueue_request(struct crypto_queue *queue, struct crypto_async_request *request); struct crypto_async_request *crypto_dequeue_request(struct crypto_queue *queue); int crypto_tfm_in_queue(struct crypto_queue *queue, struct crypto_tfm *tfm); +static inline unsigned int crypto_queue_len(struct crypto_queue *queue) +{ + return queue->qlen; +} /* These functions require the input/output to be aligned as u32. */ void crypto_inc(u8 *a, unsigned int size);