Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation: DMA API: Be more explicit that nents is always the same

The nents argument to the DMA API functions operating on scatterlists is
always the same. The documentation used different argument names and the
matter was not mentioned in Documentation/DMA-API-HOWTO.txt at all. Fix
these.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Sakari Ailus and committed by
Jonathan Corbet
7bc590b2 c6045031

+8 -3
+5
Documentation/DMA-API-HOWTO.txt
··· 681 681 682 682 as appropriate. 683 683 684 + PLEASE NOTE: The 'nents' argument to dma_sync_sg_for_cpu() and 685 + dma_sync_sg_for_device() must be the same passed to 686 + dma_map_sg(). It is _NOT_ the count returned by 687 + dma_map_sg(). 688 + 684 689 After the last DMA transfer call one of the DMA unmap routines 685 690 dma_unmap_{single,sg}(). If you don't touch the data from the first 686 691 dma_map_*() call till dma_unmap_*(), then you don't have to call the
+3 -3
Documentation/DMA-API.txt
··· 340 340 341 341 void 342 342 dma_unmap_sg(struct device *dev, struct scatterlist *sg, 343 - int nhwentries, enum dma_data_direction direction) 343 + int nents, enum dma_data_direction direction) 344 344 345 345 Unmap the previously mapped scatter/gather list. All the parameters 346 346 must be the same as those and passed in to the scatter/gather mapping ··· 356 356 dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, 357 357 enum dma_data_direction direction) 358 358 void 359 - dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, 359 + dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents, 360 360 enum dma_data_direction direction) 361 361 void 362 - dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, 362 + dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents, 363 363 enum dma_data_direction direction) 364 364 365 365 Synchronise a single contiguous or scatter/gather mapping for the CPU