public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] crct10dif: remove extra function call in crc_t10dif() and crc_t10dif_update()
@ 2015-05-06  9:18 Akinobu Mita
  2015-05-08  5:11 ` Nicholas A. Bellinger
  0 siblings, 1 reply; 2+ messages in thread
From: Akinobu Mita @ 2015-05-06  9:18 UTC (permalink / raw)
  To: target-devel
  Cc: Akinobu Mita, Tim Chen, Herbert Xu, David S. Miller, linux-crypto,
	Nicholas Bellinger, Sagi Grimberg, Martin K. Petersen,
	Christoph Hellwig, James E.J. Bottomley, linux-scsi

Calling crypto_shash_import() in crc_t10dif() and crc_t10dif_update()
is overkill as the existing crct10dif modules (crct10dif-generic and
crct10dif-pclmul) don't require.

We also do the same thing with crc32c() in lib/libcrc32.c.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: target-devel@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
---
 lib/crc-t10dif.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/crc-t10dif.c b/lib/crc-t10dif.c
index d775737..1ad33e5 100644
--- a/lib/crc-t10dif.c
+++ b/lib/crc-t10dif.c
@@ -32,9 +32,8 @@ __u16 crc_t10dif_update(__u16 crc, const unsigned char *buffer, size_t len)
 
 	desc.shash.tfm = crct10dif_tfm;
 	desc.shash.flags = 0;
+	*(__u16 *)desc.ctx = crc;
 
-	err = crypto_shash_import(&desc.shash, &crc);
-	BUG_ON(err);
 	err = crypto_shash_update(&desc.shash, buffer, len);
 	BUG_ON(err);
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-08  5:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-06  9:18 [PATCH -next] crct10dif: remove extra function call in crc_t10dif() and crc_t10dif_update() Akinobu Mita
2015-05-08  5:11 ` Nicholas A. Bellinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox