drivers: use kzalloc/kcalloc instead of 'kmalloc+memset', where possible
[linux-2.6.git] / drivers / gpu / drm / radeon / radeon_mem.c
index ed95155..988548e 100644 (file)
@@ -139,7 +139,7 @@ static int init_heap(struct mem_block **heap, int start, int size)
        if (!blocks)
                return -ENOMEM;
 
-       *heap = kmalloc(sizeof(**heap), GFP_KERNEL);
+       *heap = kzalloc(sizeof(**heap), GFP_KERNEL);
        if (!*heap) {
                kfree(blocks);
                return -ENOMEM;
@@ -150,7 +150,6 @@ static int init_heap(struct mem_block **heap, int start, int size)
        blocks->file_priv = NULL;
        blocks->next = blocks->prev = *heap;
 
-       memset(*heap, 0, sizeof(**heap));
        (*heap)->file_priv = (struct drm_file *) - 1;
        (*heap)->next = (*heap)->prev = blocks;
        return 0;