crypto: img-hash - use dma_data_direction when calling dma_map_sg
PATCH 1/1 crypto: img-hash - use dma_data_direction when calling dma_map_sg
The fourth argument of dma_map_sg() and dma_unmap_sg() is an item of dma_data_direction enum. Function img_hash_xmit_dma() wrongly used DMA_MEM_TO_DEV, which is an item of dma_transfer_direction enum.
Replace DMA_MEM_TO_DEV (which value is 1) with DMA_TO_DEVICE (which value is fortunately also 1) when calling dma_map_sg() and dma_unmap_sg().
--- drivers/crypto/img-hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/img-hash.c +2 -2
@@ -226,7 +226,7 @@ static int img_hash_xmit_dma(struct img_hash_dev *hdev, struct scatterlist *sg)struct dma_async_tx_descriptor *desc;struct img_hash_request_ctx *ctx =ahash_request_ctx (hdev->req); - ctx->dma_ct =dma_map_sg (hdev->dev, sg,1 ,DMA_MEM_TO_DEV ); + ctx->dma_ct =dma_map_sg (hdev->dev, sg,1 ,DMA_TO_DEVICE );if (ctx->dma_ct ==0 ) {dev_err (hdev->dev,"Invalid DMA sg\n" ); hdev->err = -EINVAL ;
@@ -241,7 +241,7 @@ static int img_hash_xmit_dma(struct img_hash_dev *hdev, struct scatterlist *sg)if (!desc) {dev_err (hdev->dev,"Null DMA descriptor\n" ); hdev->err = -EINVAL ; -dma_unmap_sg (hdev->dev, sg,1 ,DMA_MEM_TO_DEV ); +dma_unmap_sg (hdev->dev, sg,1 ,DMA_TO_DEVICE );return -EINVAL ; } desc->callback = img_hash_dma_callback;
Signature · 1 line
2.11.0
Herbert Xu
maintainerQuoted 9 lines · Nicolas Iooss
The fourth argument of
dma_map_sg()anddma_unmap_sg()is an item ofdma_data_directionenum. Functionimg_hash_xmit_dma()wrongly usedDMA_MEM_TO_DEV, which is an item ofdma_transfer_directionenum.Replace
DMA_MEM_TO_DEV(which value is 1) withDMA_TO_DEVICE(which value is fortunately also 1) when callingdma_map_sg()anddma_unmap_sg().Signed-off-by Nicolas Iooss <[email protected]>
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt