From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akinobu Mita Subject: [PATCH -next] crct10dif: remove extra function call in crc_t10dif() and crc_t10dif_update() Date: Wed, 6 May 2015 18:18:51 +0900 Message-ID: <1430903931-4465-1-git-send-email-akinobu.mita@gmail.com> Cc: Akinobu Mita , Tim Chen , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, Nicholas Bellinger , Sagi Grimberg , "Martin K. Petersen" , Christoph Hellwig , "James E.J. Bottomley" , linux-scsi@vger.kernel.org To: target-devel@vger.kernel.org Return-path: Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org 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 Cc: Tim Chen Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: Nicholas Bellinger Cc: Sagi Grimberg Cc: "Martin K. Petersen" Cc: Christoph Hellwig Cc: "James E.J. Bottomley" 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