Changeset 772 for GPL/trunk/alsa-kernel/pci/es1938.c
- Timestamp:
- Apr 19, 2025, 8:08:37 PM (4 months ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-6.6-LTS (added) merged: 765,768-769 /GPL/branches/uniaud32-exp (added) merged: 735-741,743-744,748-751,753-760,762-764 /GPL/branches/uniaud32-next merged: 718-734
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/pci/es1938.c
r717 r772 828 828 static int snd_es1938_capture_copy(struct snd_pcm_substream *substream, 829 829 int channel, unsigned long pos, 830 void __user *dst, unsigned long count) 830 #ifndef TARGET_OS2 831 struct iov_iter *dst, unsigned long count) 832 #else 833 void *dst, unsigned long count) 834 #endif 831 835 { 832 836 struct snd_pcm_runtime *runtime = substream->runtime; … … 835 839 if (snd_BUG_ON(pos + count > chip->dma1_size)) 836 840 return -EINVAL; 841 #ifndef TARGET_OS2 842 if (pos + count < chip->dma1_size) { 843 if (copy_to_iter(runtime->dma_area + pos + 1, count, dst) != count) 844 return -EFAULT; 845 } else { 846 if (copy_to_iter(runtime->dma_area + pos + 1, count - 1, dst) != count - 1) 847 return -EFAULT; 848 if (copy_to_iter(runtime->dma_area, 1, dst) != 1) 849 return -EFAULT; 850 } 851 #else 837 852 if (pos + count < chip->dma1_size) { 838 853 if (copy_to_user(dst, runtime->dma_area + pos + 1, count)) … … 845 860 return -EFAULT; 846 861 } 847 return 0; 848 } 849 850 static int snd_es1938_capture_copy_kernel(struct snd_pcm_substream *substream, 851 int channel, unsigned long pos, 852 void *dst, unsigned long count) 853 { 854 struct snd_pcm_runtime *runtime = substream->runtime; 855 struct es1938 *chip = snd_pcm_substream_chip(substream); 856 857 if (snd_BUG_ON(pos + count > chip->dma1_size)) 858 return -EINVAL; 859 if (pos + count < chip->dma1_size) { 860 memcpy(dst, runtime->dma_area + pos + 1, count); 861 } else { 862 memcpy(dst, runtime->dma_area + pos + 1, count - 1); 863 runtime->dma_area[0] = *((unsigned char *)dst + count - 1); 864 } 862 #endif 865 863 return 0; 866 864 } … … 991 989 .trigger = snd_es1938_capture_trigger, 992 990 .pointer = snd_es1938_capture_pointer, 993 .copy_user = snd_es1938_capture_copy, 994 .copy_kernel = snd_es1938_capture_copy_kernel, 991 .copy = snd_es1938_capture_copy, 995 992 }; 996 993
Note:
See TracChangeset
for help on using the changeset viewer.