Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1296387 > unrolled thread

[POC][PATCH 11/83] sound/oss/vidc: keep dma_buf[] as pointers

Started byAl Viro <viro@ZenIV.linux.org.uk>
First post2015-12-22 01:20 +0100
Last post2015-12-22 01:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [POC][PATCH 11/83] sound/oss/vidc: keep dma_buf[] as pointers Al Viro <viro@ZenIV.linux.org.uk> - 2015-12-22 01:20 +0100

#1296387 — [POC][PATCH 11/83] sound/oss/vidc: keep dma_buf[] as pointers

FromAl Viro <viro@ZenIV.linux.org.uk>
Date2015-12-22 01:20 +0100
Subject[POC][PATCH 11/83] sound/oss/vidc: keep dma_buf[] as pointers
Message-ID<qIiQh-548-1@gated-at.bofh.it>
From: Al Viro <viro@zeniv.linux.org.uk>

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 sound/oss/vidc.c | 8 ++++----
 sound/oss/vidc.h | 3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/sound/oss/vidc.c b/sound/oss/vidc.c
index 3196f35..6ab875d 100644
--- a/sound/oss/vidc.c
+++ b/sound/oss/vidc.c
@@ -468,13 +468,13 @@ static void __init attach_vidc(struct address_info *hw_config)
 		goto mixer_failed;
 
 	for (i = 0; i < 2; i++) {
-		dma_buf[i] = (unsigned long)get_zeroed_page(GFP_KERNEL);
+		dma_buf[i] = get_zeroed_page(GFP_KERNEL);
 		if (!dma_buf[i]) {
 			printk(KERN_ERR "%s: can't allocate required buffers\n",
 				name);
 			goto mem_failed;
 		}
-		dma_pbuf[i] = virt_to_phys((void *)dma_buf[i]);
+		dma_pbuf[i] = virt_to_phys(dma_buf[i]);
 	}
 
 	if (sound_alloc_dma(hw_config->dma, hw_config->name)) {
@@ -497,7 +497,7 @@ irq_failed:
 dma_failed:
 mem_failed:
 	for (i = 0; i < 2; i++)
-		free_page((void *)dma_buf[i]);
+		free_page(dma_buf[i]);
 	sound_unload_mixerdev(audio_devs[adev]->mixer_dev);
 mixer_failed:
 	sound_unload_audiodev(adev);
@@ -528,7 +528,7 @@ static void __exit unload_vidc(struct address_info *hw_config)
 		sound_unload_mixerdev(audio_devs[adev]->mixer_dev);
 		sound_unload_audiodev(adev);
 		for (i = 0; i < 2; i++)
-			free_page((void *)dma_buf[i]);
+			free_page(dma_buf[i]);
 	}
 }
 
diff --git a/sound/oss/vidc.h b/sound/oss/vidc.h
index 0d14247..f079010 100644
--- a/sound/oss/vidc.h
+++ b/sound/oss/vidc.h
@@ -53,7 +53,8 @@ extern irqreturn_t (*dma_interrupt) (void);
  */
 
 extern unsigned long dma_start, dma_count, dma_bufsize;
-extern unsigned long dma_buf[2], dma_pbuf[2];
+extern unsigned long dma_pbuf[2];
+extern void *dma_buf[2];
 
 /* vidc_synth.c */
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web