This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / sound / core / memory.c
index 20860fe..45d419c 100644 (file)
@@ -50,8 +50,8 @@ static long snd_alloc_kmalloc;
 static long snd_alloc_vmalloc;
 static LIST_HEAD(snd_alloc_kmalloc_list);
 static LIST_HEAD(snd_alloc_vmalloc_list);
-static DEFINE_SPINLOCK(snd_alloc_kmalloc_lock);
-static DEFINE_SPINLOCK(snd_alloc_vmalloc_lock);
+static spinlock_t snd_alloc_kmalloc_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t snd_alloc_vmalloc_lock = SPIN_LOCK_UNLOCKED;
 #define KMALLOC_MAGIC 0x87654321
 #define VMALLOC_MAGIC 0x87654320
 static snd_info_entry_t *snd_memory_info_entry;
@@ -89,7 +89,7 @@ void snd_memory_done(void)
        }
 }
 
-static void *__snd_kmalloc(size_t size, int flags, void *caller)
+void *__snd_kmalloc(size_t size, int flags, void *caller)
 {
        unsigned long cpu_flags;
        struct snd_alloc_track *t;
@@ -131,8 +131,10 @@ void snd_hidden_kfree(const void *obj)
 {
        unsigned long flags;
        struct snd_alloc_track *t;
-       if (obj == NULL)
+       if (obj == NULL) {
+               snd_printk(KERN_WARNING "null kfree (called from %p)\n", __builtin_return_address(0));
                return;
+       }
        t = snd_alloc_track_entry(obj);
        if (t->magic != KMALLOC_MAGIC) {
                snd_printk(KERN_WARNING "bad kfree (called from %p)\n", __builtin_return_address(0));
@@ -168,8 +170,10 @@ void *snd_hidden_vmalloc(unsigned long size)
 void snd_hidden_vfree(void *obj)
 {
        struct snd_alloc_track *t;
-       if (obj == NULL)
+       if (obj == NULL) {
+               snd_printk(KERN_WARNING "null vfree (called from %p)\n", __builtin_return_address(0));
                return;
+       }
        t = snd_alloc_track_entry(obj);
        if (t->magic != VMALLOC_MAGIC) {
                snd_printk(KERN_ERR "bad vfree (called from %p)\n", __builtin_return_address(0));
@@ -263,7 +267,7 @@ int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size
                size_t c = count;
                if (c > sizeof(buf))
                        c = sizeof(buf);
-               memcpy_fromio(buf, (void __iomem *)src, c);
+               memcpy_fromio(buf, src, c);
                if (copy_to_user(dst, buf, c))
                        return -EFAULT;
                count -= c;