diff options
author | Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | 2015-02-11 07:53:15 -0500 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2015-03-09 08:05:47 -0400 |
commit | 04abab698285297115e5096b3100df1064045529 (patch) | |
tree | b81b23e56d884fb10d32ffadec2bc8ae83e7211a | |
parent | 8582e267e9a29ccfd2151c5d74bc2b1440dfb827 (diff) |
include/dma-mapping: Clarify output of dma_map_sg
Although dma_map_sg returns 0 on error and it cannot return a
value < 0, the function returns a signed integer.
Most of the time, this function is used with a scatterlist structure.
This structure uses an unsigned integer for the number of memory.
A dma developer that has not read in detail DMA-API.txt, can wrongly
return a value < 0 on error.
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
-rw-r--r-- | include/linux/dma-mapping.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index c3007cb4bfa6..ac07ff090919 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -34,6 +34,10 @@ struct dma_map_ops { | |||
34 | void (*unmap_page)(struct device *dev, dma_addr_t dma_handle, | 34 | void (*unmap_page)(struct device *dev, dma_addr_t dma_handle, |
35 | size_t size, enum dma_data_direction dir, | 35 | size_t size, enum dma_data_direction dir, |
36 | struct dma_attrs *attrs); | 36 | struct dma_attrs *attrs); |
37 | /* | ||
38 | * map_sg returns 0 on error and a value > 0 on success. | ||
39 | * It should never return a value < 0. | ||
40 | */ | ||
37 | int (*map_sg)(struct device *dev, struct scatterlist *sg, | 41 | int (*map_sg)(struct device *dev, struct scatterlist *sg, |
38 | int nents, enum dma_data_direction dir, | 42 | int nents, enum dma_data_direction dir, |
39 | struct dma_attrs *attrs); | 43 | struct dma_attrs *attrs); |