aboutsummaryrefslogtreecommitdiff
path: root/sound/virtio/virtio_pcm_msg.c
AgeCommit message (Collapse)AuthorFilesLines
2021-09-30ALSA: virtio: Replace zero-length array with flexible-array memberGravatar Gustavo A. R. Silva 1-3/+2
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Also, make use of the struct_size() helper in kzalloc(). [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/78 Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/20210929191504.GA337268@embeddedor Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-03-07ALSA: virtio: handling control and I/O messages for the PCM deviceGravatar Anton Yakovlev 1-0/+414
The driver implements a message-based transport for I/O substream operations. Before the start of the substream, the hardware buffer is sliced into I/O messages, the number of which is equal to the current number of periods. The size of each message is equal to the current size of one period. I/O messages are organized in an ordered queue. The completion of the I/O message indicates an elapsed period (the only exception is the end of the stream for the capture substream). Upon completion, the message is automatically re-added to the end of the queue. Signed-off-by: Anton Yakovlev <anton.yakovlev@opensynergy.com> Link: https://lore.kernel.org/r/20210302164709.3142702-6-anton.yakovlev@opensynergy.com Signed-off-by: Takashi Iwai <tiwai@suse.de>