Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp660402rwb; Fri, 23 Sep 2022 02:18:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5e0bAbkD1AVMS+5Hkj7UDG1G2UQ3In8fTupsjT79Ch5O/k+BBXrdQd0HAB33ziVPa/vEH+ X-Received: by 2002:a17:90b:3a90:b0:202:d341:bf81 with SMTP id om16-20020a17090b3a9000b00202d341bf81mr19924861pjb.179.1663924725514; Fri, 23 Sep 2022 02:18:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663924725; cv=none; d=google.com; s=arc-20160816; b=bUB8IQrtEmf2I2gLPSEXzjR/+teQc0XO3TmQjvU6oEmFq5JogUC3J9w5lV6Y/1ZdYZ vRIgQHhQZAETDYIKwAah/flXUt1LiGcQsIpXpCHF8QYVjv9Jefv/mF/WhVA/7sk84SP0 8BQH7FwIznAa85m/r/nCEJvRIJLFhRfYZHNoic2+/7QQYVK53oIV1wuUGACGmu/vadcY Wj3VHGZgN5frEMNp4PlvfENQF12Hl1hKhluDLziBu1k0WVr4p9E2N0Vt4nQ7p8ZHxRaU p5bQoxXqz7CdQqweNBRX1nUIFSFXLy+tsKcRZleQ5WdY229LfgcDzaS+zb2wPxOgQNmR h5NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=hH3DVVOMlQWymt5gKNOI1qEJEdp4Y4BG4YlP2MZlKk4=; b=PYX1JcXvII7V1tM7uvNGjlYMk09OWRrTghlp45l347+D/Ufmuk66SyQvmy3hujZ4v9 WcWxQauw6EcOmEVjXskkNTGhWko7TS7/8JIds+ltmNMa01q2cifkGNQuLoIh240+JGuK kyGG6jDVkTfJLxXiXXWpSlEyiOEPqsYMVBTDrOwiv8V35sPqTjsj8d40WZCZDPcVkwKy jtmLYEfoFlBYeCjlTU2BCwcvKs22jkDBWsMUkHLD6omGffHsG9m+4EDK/2+RGRFwS78f RvQU9RD2wwQkkjCHGUPesiAdjpX5Tbks84EZivT/Ulnst43A6CMtks69kxmNvAgn2l8T EcYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 189-20020a6308c6000000b0042b4c537b6esi9020171pgi.623.2022.09.23.02.18.19; Fri, 23 Sep 2022 02:18:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231490AbiIWJIq (ORCPT + 99 others); Fri, 23 Sep 2022 05:08:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231610AbiIWJIe (ORCPT ); Fri, 23 Sep 2022 05:08:34 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 648A712ED82 for ; Fri, 23 Sep 2022 02:08:28 -0700 (PDT) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MYmT93T2czpTdY; Fri, 23 Sep 2022 17:05:33 +0800 (CST) Received: from cgs.huawei.com (10.244.148.83) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 23 Sep 2022 17:08:24 +0800 From: Gaosheng Cui To: , , , , CC: Subject: [PATCH 1/3] crypto: bcm - Simplify obtain the name for cipher Date: Fri, 23 Sep 2022 17:08:21 +0800 Message-ID: <20220923090823.509656-2-cuigaosheng1@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220923090823.509656-1-cuigaosheng1@huawei.com> References: <20220923090823.509656-1-cuigaosheng1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.244.148.83] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The crypto_ahash_alg_name(tfm) can obtain the name for cipher in include/crypto/hash.h, but now the function is not in use, so we use it to simplify the code, and optimize the code structure. Signed-off-by: Gaosheng Cui --- drivers/crypto/bcm/cipher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index 053315e260c2..c8c799428fe0 100644 --- a/drivers/crypto/bcm/cipher.c +++ b/drivers/crypto/bcm/cipher.c @@ -1928,7 +1928,7 @@ static int ahash_enqueue(struct ahash_request *req) /* SPU2 hardware does not compute hash of zero length data */ if ((rctx->is_final == 1) && (rctx->total_todo == 0) && (iproc_priv.spu.spu_type == SPU_TYPE_SPU2)) { - alg_name = crypto_tfm_alg_name(crypto_ahash_tfm(tfm)); + alg_name = crypto_ahash_alg_name(tfm); flow_log("Doing %sfinal %s zero-len hash request in software\n", rctx->is_final ? "" : "non-", alg_name); err = do_shash((unsigned char *)alg_name, req->result, @@ -2029,7 +2029,7 @@ static int ahash_init(struct ahash_request *req) * supported by the hardware, we need to handle it in software * by calling synchronous hash functions. */ - alg_name = crypto_tfm_alg_name(crypto_ahash_tfm(tfm)); + alg_name = crypto_ahash_alg_name(tfm); hash = crypto_alloc_shash(alg_name, 0, 0); if (IS_ERR(hash)) { ret = PTR_ERR(hash); -- 2.25.1