Skip to contentSkip to conversation

sound/sh/sh_dac_audio.c:166:53: error: passing argument 2 of 'copy_from_iter' makes integer from pointer without a cast

DISCUSSION kernel test robot 1 participant 1 message Dec 13, 2024

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f932fb9b40749d1c9a539d89bb3e288c077aafe5
commit: 9b5f8ee43e48c25fbe1a10163ec04343d750acd0 ALSA: sh: Use standard helper for buffer accesses
date:   2 weeks ago
config: sh-randconfig-r111-20241212 (https://download.01.org/0day-ci/archive/20241214/[email protected]/config)
compiler: sh4-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20241214/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

sound/sh/sh_dac_audio.c: In function 'snd_sh_dac_pcm_copy':

>> sound/sh/sh_dac_audio.c:166:53: error: passing argument 2 of 'copy_from_iter' makes integer from pointer without a cast [-Wint-conversion]
     166 |         if (copy_from_iter(chip->data_buffer + pos, src, count) != count)
         |                                                     ^~~
         |                                                     |
         |                                                     struct iov_iter *
   In file included from include/sound/pcm.h:19,
                    from sound/sh/sh_dac_audio.c:18:
   include/linux/uio.h:216:42: note: expected 'size_t' {aka 'unsigned int'} but argument is of type 'struct iov_iter *'
     216 | size_t copy_from_iter(void *addr, size_t bytes, struct iov_iter *i)
         |                                   ~~~~~~~^~~~~
>> sound/sh/sh_dac_audio.c:166:58: error: passing argument 3 of 'copy_from_iter' makes pointer from integer without a cast [-Wint-conversion]
     166 |         if (copy_from_iter(chip->data_buffer + pos, src, count) != count)
         |                                                          ^~~~~
         |                                                          |
         |                                                          long unsigned int

include/linux/uio.h:216:66: note: expected 'struct iov_iter *' but argument is of type 'long unsigned int'
216 | size_t copy_from_iter(void *addr, size_t bytes, struct iov_iter *i)
| ~~~~~~~~~~~~~~~~~^

vim +/copy_from_iter +166 sound/sh/sh_dac_audio.c

158
159 static int snd_sh_dac_pcm_copy(struct snd_pcm_substream *substream,
160 int channel, unsigned long pos,
161 struct iov_iter *src, unsigned long count)
162 {
163 /* channel is not used (interleaved data) */
164 struct snd_sh_dac *chip = snd_pcm_substream_chip(substream);
165

 > 166		if (copy_from_iter(chip->data_buffer + pos, src, count) != count)

167 return -EFAULT;
168 chip->buffer_end = chip->data_buffer + pos + count;
169
170 if (chip->empty) {
171 chip->empty = 0;
172 dac_audio_start_timer(chip);
173 }
174
175 return 0;
176 }
177

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki