aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/emu10k1/memory.c')
-rw-r--r--sound/pci/emu10k1/memory.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c
index e8ad56ed34fa..6a47672f930a 100644
--- a/sound/pci/emu10k1/memory.c
+++ b/sound/pci/emu10k1/memory.c
@@ -296,7 +296,6 @@ struct snd_util_memblk *
296snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *substream) 296snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *substream)
297{ 297{
298 struct snd_pcm_runtime *runtime = substream->runtime; 298 struct snd_pcm_runtime *runtime = substream->runtime;
299 struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream);
300 struct snd_util_memhdr *hdr; 299 struct snd_util_memhdr *hdr;
301 struct snd_emu10k1_memblk *blk; 300 struct snd_emu10k1_memblk *blk;
302 int page, err, idx; 301 int page, err, idx;
@@ -321,16 +320,9 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst
321 */ 320 */
322 idx = 0; 321 idx = 0;
323 for (page = blk->first_page; page <= blk->last_page; page++, idx++) { 322 for (page = blk->first_page; page <= blk->last_page; page++, idx++) {
323 unsigned long ofs = idx << PAGE_SHIFT;
324 dma_addr_t addr; 324 dma_addr_t addr;
325#ifdef CONFIG_SND_DEBUG 325 addr = snd_pcm_sgbuf_get_addr(substream, ofs);
326 if (idx >= sgbuf->pages) {
327 printk(KERN_ERR "emu: pages overflow! (%d-%d) for %d\n",
328 blk->first_page, blk->last_page, sgbuf->pages);
329 mutex_unlock(&hdr->block_mutex);
330 return NULL;
331 }
332#endif
333 addr = sgbuf->table[idx].addr;
334 if (! is_valid_page(emu, addr)) { 326 if (! is_valid_page(emu, addr)) {
335 printk(KERN_ERR "emu: failure page = %d\n", idx); 327 printk(KERN_ERR "emu: failure page = %d\n", idx);
336 mutex_unlock(&hdr->block_mutex); 328 mutex_unlock(&hdr->block_mutex);