Skip to content

Commit ef98a48

Browse files
committed
ASoC: Name iov_iter argument as iterator instead of buffer
While transitioning ASoC code for iov_iter usages, I kept the argument name as "buf" as the original code. But, iov_iter is an iterator, and using the name "buf" may be misleading: the crucial difference is that iov_iter can be proceeded after the operation, hence it can't be passed twice, while a simple "buffer" sounds as if reusable. To make the usage clearer, rename the argument from "buf" to "iter". There is no functional changes, just names. Fixes: 66201ca ("ASoC: component: Add generic PCM copy ops") Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/CAHk-=wje+VkXjjfVTmK-uJdG_M5=ar14QxAwK+XDiq07k_pzBg@mail.gmail.com Reviewed-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230831130457.8180-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 69d0fd3 commit ef98a48

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

include/sound/soc-component.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ struct snd_soc_component_driver {
139139
struct snd_pcm_audio_tstamp_report *audio_tstamp_report);
140140
int (*copy)(struct snd_soc_component *component,
141141
struct snd_pcm_substream *substream, int channel,
142-
unsigned long pos, struct iov_iter *buf,
142+
unsigned long pos, struct iov_iter *iter,
143143
unsigned long bytes);
144144
struct page *(*page)(struct snd_soc_component *component,
145145
struct snd_pcm_substream *substream,
@@ -511,7 +511,7 @@ int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
511511
int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream);
512512
int snd_soc_pcm_component_copy(struct snd_pcm_substream *substream,
513513
int channel, unsigned long pos,
514-
struct iov_iter *buf, unsigned long bytes);
514+
struct iov_iter *iter, unsigned long bytes);
515515
struct page *snd_soc_pcm_component_page(struct snd_pcm_substream *substream,
516516
unsigned long offset);
517517
int snd_soc_pcm_component_mmap(struct snd_pcm_substream *substream,

sound/soc/soc-component.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream)
10541054

10551055
int snd_soc_pcm_component_copy(struct snd_pcm_substream *substream,
10561056
int channel, unsigned long pos,
1057-
struct iov_iter *buf, unsigned long bytes)
1057+
struct iov_iter *iter, unsigned long bytes)
10581058
{
10591059
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
10601060
struct snd_soc_component *component;
@@ -1065,7 +1065,7 @@ int snd_soc_pcm_component_copy(struct snd_pcm_substream *substream,
10651065
if (component->driver->copy)
10661066
return soc_component_ret(component,
10671067
component->driver->copy(component, substream,
1068-
channel, pos, buf, bytes));
1068+
channel, pos, iter, bytes));
10691069

10701070
return -EINVAL;
10711071
}

sound/soc/soc-generic-dmaengine-pcm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static snd_pcm_uframes_t dmaengine_pcm_pointer(
290290
static int dmaengine_copy(struct snd_soc_component *component,
291291
struct snd_pcm_substream *substream,
292292
int channel, unsigned long hwoff,
293-
struct iov_iter *buf, unsigned long bytes)
293+
struct iov_iter *iter, unsigned long bytes)
294294
{
295295
struct snd_pcm_runtime *runtime = substream->runtime;
296296
struct dmaengine_pcm *pcm = soc_component_to_pcm(component);
@@ -302,7 +302,7 @@ static int dmaengine_copy(struct snd_soc_component *component,
302302
channel * (runtime->dma_bytes / runtime->channels);
303303

304304
if (is_playback)
305-
if (copy_from_iter(dma_ptr, bytes, buf) != bytes)
305+
if (copy_from_iter(dma_ptr, bytes, iter) != bytes)
306306
return -EFAULT;
307307

308308
if (process) {
@@ -312,7 +312,7 @@ static int dmaengine_copy(struct snd_soc_component *component,
312312
}
313313

314314
if (!is_playback)
315-
if (copy_to_iter(dma_ptr, bytes, buf) != bytes)
315+
if (copy_to_iter(dma_ptr, bytes, iter) != bytes)
316316
return -EFAULT;
317317

318318
return 0;

0 commit comments

Comments
 (0)