Re: [PATCH v3 2/5] lib: introduce crc_t10dif_update()

2015-04-28 Thread Herbert Xu
On Tue, Apr 28, 2015 at 10:38:36AM -0700, Tim Chen wrote: > > + if (update) { > + err = crypto_shash_import(&desc.shash, &crc); > + BUG_ON(err); You don't even have to make this conditional. Just always do the import since it's just doing a memcpy anyway. Che

Re: [PATCH v3 2/5] lib: introduce crc_t10dif_update()

2015-04-28 Thread Akinobu Mita
2015-04-29 2:38 GMT+09:00 Tim Chen : > There are a lot of duplicated code between crc_t10dif_update and > crc_t10dif. The only difference is for the update function > we import the crc value. I will prefer that we consolidate the code > into a local inline function that crc_t10dif_update and > cr

Re: [PATCH v3 2/5] lib: introduce crc_t10dif_update()

2015-04-28 Thread Martin K. Petersen
> "Tim" == Tim Chen writes: Tim> There are a lot of duplicated code between crc_t10dif_update and Tim> crc_t10dif. The only difference is for the update function we Tim> import the crc value. I will prefer that we consolidate the code Tim> into a local inline function that crc_t10dif_update

Re: [PATCH v3 2/5] lib: introduce crc_t10dif_update()

2015-04-28 Thread Tim Chen
On Sat, 2015-04-25 at 23:33 +0900, Akinobu Mita wrote: > This introduces crc_t10dif_update() which enables to calculate CRC > for a block which straddles multiple SG elements by calling multiple > times. > > Signed-off-by: Akinobu Mita > Cc: Tim Chen > Cc: Herbert Xu > Cc: "David S. Miller" >

Re: [PATCH v3 2/5] lib: introduce crc_t10dif_update()

2015-04-27 Thread Martin K. Petersen
> "Akinobu" == Akinobu Mita writes: Akinobu> This introduces crc_t10dif_update() which enables to calculate Akinobu> CRC for a block which straddles multiple SG elements by calling Akinobu> multiple times. Looks good. We need this for the initiator side too. Acked-by: Martin K. Petersen -

[PATCH v3 2/5] lib: introduce crc_t10dif_update()

2015-04-25 Thread Akinobu Mita
This introduces crc_t10dif_update() which enables to calculate CRC for a block which straddles multiple SG elements by calling multiple times. 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 Grimber