LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
To: Julian Calaby <julian.calaby@gmail.com>
Cc: linux-s390 <linux-s390@vger.kernel.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	linux-mips@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	linux-crypto@vger.kernel.org,
	sparclinux <sparclinux@vger.kernel.org>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 1/5] crypto: sha256 - remove duplicate generic hash init function
Date: Thu, 23 Dec 2021 10:59:18 +0800	[thread overview]
Message-ID: <83ab2a55-d31e-acb8-3cae-9c2d06f08f6c@linux.alibaba.com> (raw)
In-Reply-To: <CAGRGNgXE_5H20K+e9oejqybOGh8JezMpi2yrDJKqaZ4rWJkZdA@mail.gmail.com>

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
> <tianjia.zhang@linux.alibaba.com> 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 <tianjia.zhang@linux.alibaba.com>
>> ---
>>   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

  reply	other threads:[~2021-12-23  3:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20  9:23 [PATCH 0/5] Remove duplicate context init function for sha algorithm Tianjia Zhang
2021-12-20  9:23 ` [PATCH 1/5] crypto: sha256 - remove duplicate generic hash init function Tianjia Zhang
2021-12-22 22:35   ` Julian Calaby
2021-12-23  2:59     ` Tianjia Zhang [this message]
2021-12-20  9:23 ` [PATCH 2/5] crypto: mips/sha - remove duplicate " Tianjia Zhang
2021-12-20  9:23 ` [PATCH 3/5] crypto: powerpc/sha " Tianjia Zhang
2021-12-20  9:23 ` [PATCH 4/5] crypto: sparc/sha " Tianjia Zhang
2021-12-20  9:23 ` [PATCH 5/5] crypto: s390/sha512 - Use macros instead of direct IV numbers Tianjia Zhang
2021-12-31 11:34 ` [PATCH 0/5] Remove duplicate context init function for sha algorithm Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83ab2a55-d31e-acb8-3cae-9c2d06f08f6c@linux.alibaba.com \
    --to=tianjia.zhang@linux.alibaba.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=julian.calaby@gmail.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox