From: Miles Chen Date: Wed, 22 Feb 2017 23:40:09 +0000 (-0800) Subject: dma-debug: add comment for failed to check map error X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a5759b2bffa807a727cbf6790ecdc4df2ae8e4d4;p=linux.git dma-debug: add comment for failed to check map error Add comment for failure to check a map error to help driver developers. Link: http://lkml.kernel.org/r/1484622289-22085-1-git-send-email-miles.chen@mediatek.com Signed-off-by: Miles Chen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/dma-debug.c b/lib/dma-debug.c index 8971370bfb161..60c57ec936dbd 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c @@ -1155,6 +1155,11 @@ static void check_unmap(struct dma_debug_entry *ref) dir2name[ref->direction]); } + /* + * Drivers should use dma_mapping_error() to check the returned + * addresses of dma_map_single() and dma_map_page(). + * If not, print this warning message. See Documentation/DMA-API.txt. + */ if (entry->map_err_type == MAP_ERR_NOT_CHECKED) { err_printk(ref->dev, entry, "DMA-API: device driver failed to check map error"