diff mbox series

[RFC,1/4] dmaengine: Document dmaengine_prep_dma_memset

Message ID 20220128183948.3924558-2-benjamin.walker@intel.com (mailing list archive)
State Superseded
Headers show
Series dmaengine: memset clarifications and fixes | expand

Commit Message

Ben Walker Jan. 28, 2022, 6:39 p.m. UTC
Document this function to make clear the expected behavior of the
'value' parameter. It was intended to match the behavior of POSIX memset
as laid out here:

https://lore.kernel.org/dmaengine/YejrA5ZWZ3lTRO%2F1@matsya/

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
---
 include/linux/dmaengine.h | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Vinod Koul Feb. 15, 2022, 11:44 a.m. UTC | #1
On 28-01-22, 11:39, Ben Walker wrote:
> Document this function to make clear the expected behavior of the
> 'value' parameter. It was intended to match the behavior of POSIX memset
> as laid out here:
> 
> https://lore.kernel.org/dmaengine/YejrA5ZWZ3lTRO%2F1@matsya/

Can we add this to Documentation too? Documentation/driver-api/dmaengine/

> 
> Signed-off-by: Ben Walker <benjamin.walker@intel.com>
> ---
>  include/linux/dmaengine.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index 842d4f7ca752d..3d3e663e17ac7 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -1031,6 +1031,14 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_interleaved_dma(
>  	return chan->device->device_prep_interleaved_dma(chan, xt, flags);
>  }
>  
> +/**
> + * dmaengine_prep_dma_memset() - Prepare a DMA memset descriptor.
> + * @chan: The channel to be used for this descriptor
> + * @dest: Address of buffer to be set
> + * @value: Treated as a single byte value that fills the destination buffer
> + * @len: The total size of dest
> + * @flags: DMA engine flags
> + */
>  static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_memset(
>  		struct dma_chan *chan, dma_addr_t dest, int value, size_t len,
>  		unsigned long flags)
> -- 
> 2.33.1
Ben Walker Feb. 18, 2022, 9:37 p.m. UTC | #2
On 2/15/2022 4:44 AM, Vinod Koul wrote:
> On 28-01-22, 11:39, Ben Walker wrote:
>> Document this function to make clear the expected behavior of the
>> 'value' parameter. It was intended to match the behavior of POSIX memset
>> as laid out here:
>>
>> https://lore.kernel.org/dmaengine/YejrA5ZWZ3lTRO%2F1@matsya/
> 
> Can we add this to Documentation too? Documentation/driver-api/dmaengine/

Ack. Updated in my v2.

> 
>>
>> Signed-off-by: Ben Walker <benjamin.walker@intel.com>
>> ---
>>   include/linux/dmaengine.h | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
>> index 842d4f7ca752d..3d3e663e17ac7 100644
>> --- a/include/linux/dmaengine.h
>> +++ b/include/linux/dmaengine.h
>> @@ -1031,6 +1031,14 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_interleaved_dma(
>>   	return chan->device->device_prep_interleaved_dma(chan, xt, flags);
>>   }
>>   
>> +/**
>> + * dmaengine_prep_dma_memset() - Prepare a DMA memset descriptor.
>> + * @chan: The channel to be used for this descriptor
>> + * @dest: Address of buffer to be set
>> + * @value: Treated as a single byte value that fills the destination buffer
>> + * @len: The total size of dest
>> + * @flags: DMA engine flags
>> + */
>>   static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_memset(
>>   		struct dma_chan *chan, dma_addr_t dest, int value, size_t len,
>>   		unsigned long flags)
>> -- 
>> 2.33.1
>
diff mbox series

Patch

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 842d4f7ca752d..3d3e663e17ac7 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -1031,6 +1031,14 @@  static inline struct dma_async_tx_descriptor *dmaengine_prep_interleaved_dma(
 	return chan->device->device_prep_interleaved_dma(chan, xt, flags);
 }
 
+/**
+ * dmaengine_prep_dma_memset() - Prepare a DMA memset descriptor.
+ * @chan: The channel to be used for this descriptor
+ * @dest: Address of buffer to be set
+ * @value: Treated as a single byte value that fills the destination buffer
+ * @len: The total size of dest
+ * @flags: DMA engine flags
+ */
 static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_memset(
 		struct dma_chan *chan, dma_addr_t dest, int value, size_t len,
 		unsigned long flags)