Ignore:
Timestamp:
Apr 19, 2025, 8:08:37 PM (4 months ago)
Author:
David Azarewicz
Message:

Merge in changes from 6.6-LTS branch.
Fixed additional 25+ problems.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/pci/es1938.c

    r717 r772  
    828828static int snd_es1938_capture_copy(struct snd_pcm_substream *substream,
    829829                                   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
    831835{
    832836        struct snd_pcm_runtime *runtime = substream->runtime;
     
    835839        if (snd_BUG_ON(pos + count > chip->dma1_size))
    836840                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
    837852        if (pos + count < chip->dma1_size) {
    838853                if (copy_to_user(dst, runtime->dma_area + pos + 1, count))
     
    845860                        return -EFAULT;
    846861        }
    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
    865863        return 0;
    866864}
     
    991989        .trigger =      snd_es1938_capture_trigger,
    992990        .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,
    995992};
    996993
Note: See TracChangeset for help on using the changeset viewer.