From patchwork Thu Jan 25 03:09:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10183527 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 37A2660388 for ; Thu, 25 Jan 2018 03:10:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FB14289DF for ; Thu, 25 Jan 2018 03:10:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14B4F28991; Thu, 25 Jan 2018 03:10:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A79C1289DC for ; Thu, 25 Jan 2018 03:10:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933218AbeAYDKC (ORCPT ); Wed, 24 Jan 2018 22:10:02 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:46822 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932956AbeAYDKC (ORCPT ); Wed, 24 Jan 2018 22:10:02 -0500 Received: by mail-pf0-f196.google.com with SMTP id y5so4759691pff.13 for ; Wed, 24 Jan 2018 19:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=BhYuC3BfKQT1mUAaqdnVfNXCN3365ZfIXKJIdpkwsAI=; b=C/W80yf83iQLiVGmEahZa8TV5ERQfc7HGVy07UqTtZPtteKvqi72HL69lSbZjkcg/V 4HewLpubDSKmpMj+X/F5VmdcFUXq9ystJYTh7o8+OOKwYsH3lBCiPSGN0yjuOBWBKiAn Xq9HxpBgPAvJxRtPndQMf3jnjQJ4oBLdCb3wPQYUFVtIEKx0AbMxScbQ3RMlhraV5Z2Y VrOCEVchD5YyOSHTOevFFLQWz6wu1gD6TlSA2qdNRpgdR0oynpCYTEy6hb5BftOCIFjb pNp5LShFcAbzap93SiJT/D49hhRXdWHnJ/cLXGzHaHTLA8e8LET5kUJaZVY0uHzw+Yjw Ol9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BhYuC3BfKQT1mUAaqdnVfNXCN3365ZfIXKJIdpkwsAI=; b=l9LSBm2G6X47OCaBory/SZGBY8KUGa8FoKHwh6RJ5CyXM8TRrS1GDFu/xD9Fug7gx+ hv9B1GSQUsfkx/HYDtLwIkWUqTel4awQhj3n7nxwPB9JnvJd9zyOTcM3XgAZBBRzviWL TEBp6Y/rqMcQjN5ybXVAlZRA2DHUkaIZyAfx25QzBfxwR39b3uWEipYTQQ3MXBoMjgAT une8hpIwx+aH+33UI2GgsST6cH/MBHb63vRfZilqSLULpJYH+G44iwsdo/iISSFgAi61 TGf0TyGUnJoic1C3xNgoN2hwVgWSs1PokhSAjOHJXSBp1akm9SNn+witHtH+9/T/+8+N l1uQ== X-Gm-Message-State: AKwxytdXME3oIm0M5LCdK9bzyYyIQmJrKLxhH9RlzmlMu1wraQBI3MZ5 NcDG1aMp6SYWks1Ph9heApT8iiEw X-Google-Smtp-Source: AH8x226YNyb9dA+WYgGxggef1guNdZgTpMkN+wW6S1BkqO98mZkw4y8xvnFNyj4jBrXqJNg8PPEzDA== X-Received: by 10.99.146.86 with SMTP id s22mr11798416pgn.209.1516849801133; Wed, 24 Jan 2018 19:10:01 -0800 (PST) Received: from zzz.localdomain (c-67-185-97-198.hsd1.wa.comcast.net. [67.185.97.198]) by smtp.gmail.com with ESMTPSA id 63sm12808798pft.11.2018.01.24.19.10.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 19:10:00 -0800 (PST) From: Eric Biggers To: linux-crypto@vger.kernel.org, Herbert Xu Cc: "David S . Miller" , Tim Chen , Eric Biggers Subject: [PATCH] crypto: mcryptd - remove pointless wrapper functions Date: Wed, 24 Jan 2018 19:09:07 -0800 Message-Id: <20180125030907.679-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.16.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers There is no need for ahash_mcryptd_{update,final,finup,digest}(); we should just call crypto_ahash_*() directly. Signed-off-by: Eric Biggers Acked-by: Tim Chen --- crypto/mcryptd.c | 34 ++++------------------------------ include/crypto/internal/hash.h | 5 ----- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/crypto/mcryptd.c b/crypto/mcryptd.c index fe5129d6ff4e..f14152147ce8 100644 --- a/crypto/mcryptd.c +++ b/crypto/mcryptd.c @@ -367,7 +367,7 @@ static void mcryptd_hash_update(struct crypto_async_request *req_async, int err) goto out; rctx->out = req->result; - err = ahash_mcryptd_update(&rctx->areq); + err = crypto_ahash_update(&rctx->areq); if (err) { req->base.complete = rctx->complete; goto out; @@ -394,7 +394,7 @@ static void mcryptd_hash_final(struct crypto_async_request *req_async, int err) goto out; rctx->out = req->result; - err = ahash_mcryptd_final(&rctx->areq); + err = crypto_ahash_final(&rctx->areq); if (err) { req->base.complete = rctx->complete; goto out; @@ -420,7 +420,7 @@ static void mcryptd_hash_finup(struct crypto_async_request *req_async, int err) if (unlikely(err == -EINPROGRESS)) goto out; rctx->out = req->result; - err = ahash_mcryptd_finup(&rctx->areq); + err = crypto_ahash_finup(&rctx->areq); if (err) { req->base.complete = rctx->complete; @@ -455,7 +455,7 @@ static void mcryptd_hash_digest(struct crypto_async_request *req_async, int err) rctx->complete, req_async); rctx->out = req->result; - err = ahash_mcryptd_digest(desc); + err = crypto_ahash_init(desc) ?: crypto_ahash_finup(desc); out: local_bh_disable(); @@ -612,32 +612,6 @@ struct mcryptd_ahash *mcryptd_alloc_ahash(const char *alg_name, } EXPORT_SYMBOL_GPL(mcryptd_alloc_ahash); -int ahash_mcryptd_digest(struct ahash_request *desc) -{ - return crypto_ahash_init(desc) ?: ahash_mcryptd_finup(desc); -} - -int ahash_mcryptd_update(struct ahash_request *desc) -{ - /* alignment is to be done by multi-buffer crypto algorithm if needed */ - - return crypto_ahash_update(desc); -} - -int ahash_mcryptd_finup(struct ahash_request *desc) -{ - /* alignment is to be done by multi-buffer crypto algorithm if needed */ - - return crypto_ahash_finup(desc); -} - -int ahash_mcryptd_final(struct ahash_request *desc) -{ - /* alignment is to be done by multi-buffer crypto algorithm if needed */ - - return crypto_ahash_final(desc); -} - struct crypto_ahash *mcryptd_ahash_child(struct mcryptd_ahash *tfm) { struct mcryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h index 27040a46d50a..a0b0ad9d585e 100644 --- a/include/crypto/internal/hash.h +++ b/include/crypto/internal/hash.h @@ -126,11 +126,6 @@ int shash_ahash_update(struct ahash_request *req, struct shash_desc *desc); int shash_ahash_finup(struct ahash_request *req, struct shash_desc *desc); int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc); -int ahash_mcryptd_update(struct ahash_request *desc); -int ahash_mcryptd_final(struct ahash_request *desc); -int ahash_mcryptd_finup(struct ahash_request *desc); -int ahash_mcryptd_digest(struct ahash_request *desc); - int crypto_init_shash_ops_async(struct crypto_tfm *tfm); static inline void *crypto_ahash_ctx(struct crypto_ahash *tfm)