From patchwork Wed Nov 25 17:48:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kuleshov X-Patchwork-Id: 7701921 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 19E249F1BE for ; Wed, 25 Nov 2015 17:50:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55D3C207B1 for ; Wed, 25 Nov 2015 17:50:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8166C207AE for ; Wed, 25 Nov 2015 17:50:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751210AbbKYRuz (ORCPT ); Wed, 25 Nov 2015 12:50:55 -0500 Received: from mail-lf0-f54.google.com ([209.85.215.54]:35002 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750832AbbKYRuy (ORCPT ); Wed, 25 Nov 2015 12:50:54 -0500 Received: by lfdl133 with SMTP id l133so69502734lfd.2; Wed, 25 Nov 2015 09:50:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=XisBYJrrn86BqhpXq0WkZcDyCrkQgm15KrSnr4VTOXg=; b=q6Ll2rThY0n8+vfSSq8FoMunizfJoK/kSZgTcGXLEfm0cf/aK3zOSCDIZMpRTHsQ/9 2O2MU7zSi0ogBPwgkgPYa0/oBVfZYd0lH6ut3EMgKUCroomnIYqLBC8q19HVRR6SQHSZ ain1L81edEhIWbPtiNeImMav04zVSA06a7JEIt3TcM2mElv5BQe5gEyMP13aifo1/6Yh sNGa6ecfNDDPzpBiln0SmXCmrV2HLDO1/OrrxMomCedTuec2gAfvhTL9EvN8XagAM2B8 A04Toy/K3P7xkYYNwIF3srgd1ureeOnSmm7MkD1xtyCO5zhhgx7QY8P0nsZqbePUhXTP CO3A== X-Received: by 10.25.137.7 with SMTP id l7mr9399132lfd.63.1448473852805; Wed, 25 Nov 2015 09:50:52 -0800 (PST) Received: from localhost.localhost ([95.56.110.126]) by smtp.gmail.com with ESMTPSA id 194sm3479056lfd.4.2015.11.25.09.50.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Nov 2015 09:50:52 -0800 (PST) From: Alexander Kuleshov To: Herbert Xu Cc: "David S . Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Kuleshov Subject: [PATCH] crypto/cryptod: use crypto_skcipher_type() for getting skcipher type Date: Wed, 25 Nov 2015 23:48:28 +0600 Message-Id: <1448473708-9609-1-git-send-email-kuleshovmail@gmail.com> X-Mailer: git-send-email 2.6.2.485.g1bc8fea 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.3 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 The provides inline function - crypto_skcipher_type(). Let's use it in the cryptd_alloc_ablkcipher() instead of direct calculation. Signed-off-by: Alexander Kuleshov --- crypto/cryptd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crypto/cryptd.c b/crypto/cryptd.c index c81861b..c4af8aa 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c @@ -887,8 +887,7 @@ struct cryptd_ablkcipher *cryptd_alloc_ablkcipher(const char *alg_name, if (snprintf(cryptd_alg_name, CRYPTO_MAX_ALG_NAME, "cryptd(%s)", alg_name) >= CRYPTO_MAX_ALG_NAME) return ERR_PTR(-EINVAL); - type &= ~(CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_GENIV); - type |= CRYPTO_ALG_TYPE_BLKCIPHER; + type = crypto_skcipher_type(type); mask &= ~CRYPTO_ALG_TYPE_MASK; mask |= (CRYPTO_ALG_GENIV | CRYPTO_ALG_TYPE_BLKCIPHER_MASK); tfm = crypto_alloc_base(cryptd_alg_name, type, mask);