From patchwork Fri Oct 7 21:13:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9367631 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 AFD1D600C8 for ; Fri, 7 Oct 2016 21:14:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D29B297EF for ; Fri, 7 Oct 2016 21:14:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91A2D29834; Fri, 7 Oct 2016 21:14:59 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 31FEB297EF for ; Fri, 7 Oct 2016 21:14:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933054AbcJGVOu (ORCPT ); Fri, 7 Oct 2016 17:14:50 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:34656 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932452AbcJGVOq (ORCPT ); Fri, 7 Oct 2016 17:14:46 -0400 Received: by mail-pf0-f179.google.com with SMTP id e6so28600830pfk.1 for ; Fri, 07 Oct 2016 14:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=55zxY39hfi+7jecWfm+zZeNa9n8+iZkMrVOfPGaWtpQ=; b=Y+R7z7+0bg4g4aUSK+zoPrJ2OQH+xCyThfv1ihgyQMmemeH9PG91cQGUWlbOT9ucPF wKGTzeW6mKcmoK5+7PFaEkmW0lG3Q87VTtfT+PUYNJzb4HUieLLwUTx/rXi6Y/nQeXcZ UpVfzoV49fEfTG6RwORcVtCR5fr7v2jrs0RHeXGuSWJBGSj+7uVtuLLVO86jhscvA1hv o54M851pcEEL1Y1ZTqLjLw6ML+a7QtC9nZsy+S5OlugMlESzNWZ40mMOzBYEKmdZo24e wqvLb06e4YQS9ljBlxoPLG/43CThqZ0lzGJ8yPq+hxFHXf9ma3QEDA5RcO0+3TCl0bIs tpMQ== 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=55zxY39hfi+7jecWfm+zZeNa9n8+iZkMrVOfPGaWtpQ=; b=ChV817TL60vu9xhRiqBu5lvdWISVvRcOKi86VIwyPIF8pjKRWp0Dy76IpbVaN7PgiS A/i8ypRw0kQqVow7x7f2gsdILTQP4UzK/fJngrfpUrXmtO19TKG1EH4KXGYjlUKR6s5P M11MwPWCnkJ5/FtlhBsGqMgc/7+5p5q+beyrg0KtlJFduOyKME+auxn9V9wpr8B38Vw4 7p22WKpZFxHs2d6HO7o1H5f5zlag88rfcvX0GQafqm7cCur/sxltRmpT9q37ZrAgkFdk mBZVfjdxeD7/BPuK2ptZIyNb2rpPZgTTAW+KbpSM0dlVwJM+/T+O/Wh4J2K7zckoyKUD mRPQ== X-Gm-Message-State: AA6/9RkxkvjnvSkkuJmxY7HeokqEg+Uaz41d4ysw1d8QrBvJaWMO1K6ofsn+JefByqTqb+4P X-Received: by 10.98.87.69 with SMTP id l66mr29052933pfb.128.1475874885628; Fri, 07 Oct 2016 14:14:45 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([172.23.164.123]) by smtp.gmail.com with ESMTPSA id id6sm33224295pad.28.2016.10.07.14.14.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Oct 2016 14:14:44 -0700 (PDT) From: Eric Biggers To: herbert@gondor.apana.org.au, davem@davemloft.net Cc: linux-crypto@vger.kernel.org, Eric Biggers Subject: [PATCH] crypto: api - Remove no-op exit_ops code Date: Fri, 7 Oct 2016 14:13:35 -0700 Message-Id: <1475874815-136813-2-git-send-email-ebiggers@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 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 crypto_exit_cipher_ops() and crypto_exit_compress_ops() are no-ops and have been for a long time, so remove them. Signed-off-by: Eric Biggers --- crypto/api.c | 20 ++------------------ crypto/cipher.c | 4 ---- crypto/compress.c | 4 ---- crypto/internal.h | 3 --- 4 files changed, 2 insertions(+), 29 deletions(-) diff --git a/crypto/api.c b/crypto/api.c index bbc147c..a88729f 100644 --- a/crypto/api.c +++ b/crypto/api.c @@ -310,24 +310,8 @@ static void crypto_exit_ops(struct crypto_tfm *tfm) { const struct crypto_type *type = tfm->__crt_alg->cra_type; - if (type) { - if (tfm->exit) - tfm->exit(tfm); - return; - } - - switch (crypto_tfm_alg_type(tfm)) { - case CRYPTO_ALG_TYPE_CIPHER: - crypto_exit_cipher_ops(tfm); - break; - - case CRYPTO_ALG_TYPE_COMPRESS: - crypto_exit_compress_ops(tfm); - break; - - default: - BUG(); - } + if (type && tfm->exit) + tfm->exit(tfm); } static unsigned int crypto_ctxsize(struct crypto_alg *alg, u32 type, u32 mask) diff --git a/crypto/cipher.c b/crypto/cipher.c index 39541e0..94fa355 100644 --- a/crypto/cipher.c +++ b/crypto/cipher.c @@ -116,7 +116,3 @@ int crypto_init_cipher_ops(struct crypto_tfm *tfm) return 0; } - -void crypto_exit_cipher_ops(struct crypto_tfm *tfm) -{ -} diff --git a/crypto/compress.c b/crypto/compress.c index c33f076..f2d5229 100644 --- a/crypto/compress.c +++ b/crypto/compress.c @@ -42,7 +42,3 @@ int crypto_init_compress_ops(struct crypto_tfm *tfm) return 0; } - -void crypto_exit_compress_ops(struct crypto_tfm *tfm) -{ -} diff --git a/crypto/internal.h b/crypto/internal.h index 7eefcdb..f073204 100644 --- a/crypto/internal.h +++ b/crypto/internal.h @@ -76,9 +76,6 @@ struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask); int crypto_init_cipher_ops(struct crypto_tfm *tfm); int crypto_init_compress_ops(struct crypto_tfm *tfm); -void crypto_exit_cipher_ops(struct crypto_tfm *tfm); -void crypto_exit_compress_ops(struct crypto_tfm *tfm); - struct crypto_larval *crypto_larval_alloc(const char *name, u32 type, u32 mask); void crypto_larval_kill(struct crypto_alg *alg); struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask);