From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50F70C433F5 for ; Thu, 23 Dec 2021 03:00:14 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4JKFL41pr3z3bhg for ; Thu, 23 Dec 2021 14:00:12 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.54; helo=out30-54.freemail.mail.aliyun.com; envelope-from=tianjia.zhang@linux.alibaba.com; receiver=) Received: from out30-54.freemail.mail.aliyun.com (out30-54.freemail.mail.aliyun.com [115.124.30.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4JKFKb5Rbhz2yYJ for ; Thu, 23 Dec 2021 13:59:41 +1100 (AEDT) X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R121e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04400; MF=tianjia.zhang@linux.alibaba.com; NM=1; PH=DS; RN=17; SR=0; TI=SMTPD_---0V.Thv79_1640228358; Received: from 30.240.100.46(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0V.Thv79_1640228358) by smtp.aliyun-inc.com(127.0.0.1); Thu, 23 Dec 2021 10:59:20 +0800 Message-ID: <83ab2a55-d31e-acb8-3cae-9c2d06f08f6c@linux.alibaba.com> Date: Thu, 23 Dec 2021 10:59:18 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH 1/5] crypto: sha256 - remove duplicate generic hash init function Content-Language: en-US To: Julian Calaby References: <20211220092318.5793-1-tianjia.zhang@linux.alibaba.com> <20211220092318.5793-2-tianjia.zhang@linux.alibaba.com> From: Tianjia Zhang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-s390 , Thomas Bogendoerfer , Herbert Xu , Vasily Gorbik , Heiko Carstens , linux-mips@vger.kernel.org, LKML , Paul Mackerras , linux-crypto@vger.kernel.org, sparclinux , Alexander Gordeev , Christian Borntraeger , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi Julian, On 12/23/21 6:35 AM, Julian Calaby wrote: > Hi Tianjia, > > On Mon, Dec 20, 2021 at 8:25 PM Tianjia Zhang > wrote: >> >> crypto_sha256_init() and sha256_base_init() are the same repeated >> implementations, remove the crypto_sha256_init() in generic >> implementation, sha224 is the same process. >> >> Signed-off-by: Tianjia Zhang >> --- >> crypto/sha256_generic.c | 16 ++-------------- >> 1 file changed, 2 insertions(+), 14 deletions(-) >> >> diff --git a/crypto/sha256_generic.c b/crypto/sha256_generic.c >> index 3b377197236e..bf147b01e313 100644 >> --- a/crypto/sha256_generic.c >> +++ b/crypto/sha256_generic.c >> @@ -72,7 +60,7 @@ EXPORT_SYMBOL(crypto_sha256_finup); >> >> static struct shash_alg sha256_algs[2] = { { >> .digestsize = SHA256_DIGEST_SIZE, >> - .init = crypto_sha256_init, >> + .init = sha256_base_init, >> .update = crypto_sha256_update, >> .final = crypto_sha256_final, >> .finup = crypto_sha256_finup, >> @@ -86,7 +74,7 @@ static struct shash_alg sha256_algs[2] = { { >> } >> }, { >> .digestsize = SHA224_DIGEST_SIZE, >> - .init = crypto_sha224_init, >> + .init = sha224_base_init, >> .update = crypto_sha256_update, >> .final = crypto_sha256_final, >> .finup = crypto_sha256_finup, > > Aren't these two functions defined as static inline functions? It > appears that these crypto_ wrappers were added so there's "actual" > referenceable functions for these structs. > > Did this actually compile? > > Thanks, > Judging from the compilation results, there is really no difference, but the modification made by this patch is still necessary, because crypto_sha256_init() wrapper and sha256_base_init() are two completely duplicate functions. Best regards, Tianjia