Hi Christophe, kernel test robot noticed the following build errors:
[auto build test ERROR on tiwai-sound/for-next] [also build test ERROR on tiwai-sound/for-linus linus/master v6.15 next-20250606] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Christophe-Leroy/ALSA-pcm-Convert-multiple-get-put-_user-to-user_access_begin-user_access_end/20250607-195119 base: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next patch link: https://lore.kernel.org/r/bf9288392b1d4b9e92fe29212d9cb933c5b3fbae.1749296015.git.christophe.leroy%40csgroup.eu patch subject: [PATCH] ALSA: pcm: Convert multiple {get/put}_user to user_access_begin/user_access_end() config: x86_64-buildonly-randconfig-003-20250607 (https://download.01.org/0day-ci/archive/20250607/202506072119.6uafebw1-...@intel.com/config) compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250607/202506072119.6uafebw1-...@intel.com/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 <l...@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202506072119.6uafebw1-...@intel.com/ All errors (new ones prefixed by >>): >> sound/core/pcm_native.c:3068:2: error: call to undeclared function >> 'unsafe_copy_from_user'; ISO C99 and later do not support implicit function >> declarations [-Wimplicit-function-declaration] 3068 | unsafe_copy_from_user(&sync_ptr.c.control, &(_sync_ptr->c.control), | ^ >> sound/core/pcm_native.c:3069:47: error: use of undeclared identifier 'Efault' 3069 | sizeof(struct snd_pcm_mmap_control), Efault); | ^ 2 errors generated. vim +/unsafe_copy_from_user +3068 sound/core/pcm_native.c 3053 3054 static int snd_pcm_sync_ptr(struct snd_pcm_substream *substream, 3055 struct snd_pcm_sync_ptr __user *_sync_ptr) 3056 { 3057 struct snd_pcm_runtime *runtime = substream->runtime; 3058 struct snd_pcm_sync_ptr sync_ptr; 3059 volatile struct snd_pcm_mmap_status *status; 3060 volatile struct snd_pcm_mmap_control *control; 3061 int err; 3062 3063 memset(&sync_ptr, 0, sizeof(sync_ptr)); 3064 3065 if (!user_read_access_begin(_sync_ptr, sizeof(*_sync_ptr))) 3066 return -EFAULT; 3067 unsafe_get_user(sync_ptr.flags, (unsigned __user *)&(_sync_ptr->flags), Efault); > 3068 unsafe_copy_from_user(&sync_ptr.c.control, > &(_sync_ptr->c.control), > 3069 sizeof(struct snd_pcm_mmap_control), > Efault); 3070 user_read_access_end(); 3071 3072 status = runtime->status; 3073 control = runtime->control; 3074 if (sync_ptr.flags & SNDRV_PCM_SYNC_PTR_HWSYNC) { 3075 err = snd_pcm_hwsync(substream); 3076 if (err < 0) 3077 return err; 3078 } 3079 scoped_guard(pcm_stream_lock_irq, substream) { 3080 if (!(sync_ptr.flags & SNDRV_PCM_SYNC_PTR_APPL)) { 3081 err = pcm_lib_apply_appl_ptr(substream, 3082 sync_ptr.c.control.appl_ptr); 3083 if (err < 0) 3084 return err; 3085 } else { 3086 sync_ptr.c.control.appl_ptr = control->appl_ptr; 3087 } 3088 if (!(sync_ptr.flags & SNDRV_PCM_SYNC_PTR_AVAIL_MIN)) 3089 control->avail_min = sync_ptr.c.control.avail_min; 3090 else 3091 sync_ptr.c.control.avail_min = control->avail_min; 3092 sync_ptr.s.status.state = status->state; 3093 sync_ptr.s.status.hw_ptr = status->hw_ptr; 3094 sync_ptr.s.status.tstamp = status->tstamp; 3095 sync_ptr.s.status.suspended_state = status->suspended_state; 3096 sync_ptr.s.status.audio_tstamp = status->audio_tstamp; 3097 } 3098 if (!(sync_ptr.flags & SNDRV_PCM_SYNC_PTR_APPL)) 3099 snd_pcm_dma_buffer_sync(substream, SNDRV_DMA_SYNC_DEVICE); 3100 if (copy_to_user(_sync_ptr, &sync_ptr, sizeof(sync_ptr))) 3101 return -EFAULT; 3102 return 0; 3103 3104 Efault: 3105 user_read_access_end(); 3106 3107 return -EFAULT; 3108 } 3109 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki