Re: [PATCH 2/2] crypto: mxs_dcp: Use sg_mapping_iter to copy data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 18, 2021 at 05:14:11PM -0400, Sean Anderson wrote:
> This uses the sg_miter_*() functions to copy data, instead of doing it
> ourselves. Using sg_copy_buffer() would be better, but this way we don't
> have to keep traversing the beginning of the scatterlist every time we
> do another copy.
> 
> In addition to reducing code size, this fixes the following oops
> resulting from failing to kmap the page:

Thanks for the patch.  Just a minor nit:

> @@ -365,25 +364,13 @@ static int mxs_dcp_aes_block_crypt(struct crypto_async_request *arq)
>  
>  				out_tmp = out_buf;
>  				last_out_len = actx->fill;
> -				while (dst && actx->fill) {
> -					if (!split) {
> -						dst_buf = sg_virt(dst);
> -						dst_off = 0;
> -					}
> -					rem = min(sg_dma_len(dst) - dst_off,
> -						  actx->fill);
> -
> -					memcpy(dst_buf + dst_off, out_tmp, rem);
> +
> +				while (sg_miter_next(&dst_iter) && actx->fill) {
> +					rem = min(dst_iter.length, actx->fill);

This comparison generates a sparse warning due to conflicting types,
please fix this and resubmit.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux