* [PATCH 1/2] ALSA: memalloc: Make snd_{malloc|free}_dev_iram() static
@ 2013-10-29 11:04 Takashi Iwai
2013-10-29 11:04 ` [PATCH 2/2] ALSA: memalloc: NULL-initialize in snd_malloc_dev_iram() Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Takashi Iwai @ 2013-10-29 11:04 UTC (permalink / raw)
To: alsa-devel
These are used only locally.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/core/memalloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index 809fd79ecad6..278248b8f22a 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -167,7 +167,7 @@ static void snd_free_dev_pages(struct device *dev, size_t size, void *ptr,
*
* This function requires iram phandle provided via of_node
*/
-void snd_malloc_dev_iram(struct snd_dma_buffer *dmab, size_t size)
+static void snd_malloc_dev_iram(struct snd_dma_buffer *dmab, size_t size)
{
struct device *dev = dmab->dev.dev;
struct gen_pool *pool = NULL;
@@ -192,7 +192,7 @@ void snd_malloc_dev_iram(struct snd_dma_buffer *dmab, size_t size)
* snd_free_dev_iram - free allocated specific memory from on-chip internal ram
* @dmab: buffer allocation record to store the allocated data
*/
-void snd_free_dev_iram(struct snd_dma_buffer *dmab)
+static void snd_free_dev_iram(struct snd_dma_buffer *dmab)
{
struct gen_pool *pool = dmab->private_data;
--
1.8.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] ALSA: memalloc: NULL-initialize in snd_malloc_dev_iram()
2013-10-29 11:04 [PATCH 1/2] ALSA: memalloc: Make snd_{malloc|free}_dev_iram() static Takashi Iwai
@ 2013-10-29 11:04 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2013-10-29 11:04 UTC (permalink / raw)
To: alsa-devel
dmab->area and addr fields should be cleared at the head of
snd_malloc_dev_iram() as especially dmab->area is used to indicate the
allocation failure / fallback.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/core/memalloc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index 278248b8f22a..9d93f02c6285 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -172,6 +172,9 @@ static void snd_malloc_dev_iram(struct snd_dma_buffer *dmab, size_t size)
struct device *dev = dmab->dev.dev;
struct gen_pool *pool = NULL;
+ dmab->area = NULL;
+ dmab->addr = 0;
+
if (dev->of_node)
pool = of_get_named_gen_pool(dev->of_node, "iram", 0);
--
1.8.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-29 11:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-29 11:04 [PATCH 1/2] ALSA: memalloc: Make snd_{malloc|free}_dev_iram() static Takashi Iwai
2013-10-29 11:04 ` [PATCH 2/2] ALSA: memalloc: NULL-initialize in snd_malloc_dev_iram() Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.