]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Staging: android: ion: duplicated clearing of sg_table
authorGioh Kim <gioh.kim@lge.com>
Thu, 24 Apr 2014 23:24:24 +0000 (08:24 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2014 22:17:31 +0000 (15:17 -0700)
Because sg_table is cleared in sg_alloc_table via memset we don't need to use
kzalloc to allocate sg_table.

Signed-off-by: Gioh Kim <gioh.kim@lge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ion/ion_carveout_heap.c
drivers/staging/android/ion/ion_chunk_heap.c
drivers/staging/android/ion/ion_system_heap.c

index 3cb05b9b0e93dd0183fa08372100e0074aa588e4..dcb6f2196c8742ed08a364ac3f438b0a45260b4e 100644 (file)
@@ -81,7 +81,7 @@ static int ion_carveout_heap_allocate(struct ion_heap *heap,
        if (align > PAGE_SIZE)
                return -EINVAL;
 
-       table = kzalloc(sizeof(struct sg_table), GFP_KERNEL);
+       table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
        if (!table)
                return -ENOMEM;
        ret = sg_alloc_table(table, 1, GFP_KERNEL);
index d40f5f831808aa38b84d64c23954a504e059df32..3f2c12ba4d149aa9478e40d49ae375792252ec6e 100644 (file)
@@ -55,7 +55,7 @@ static int ion_chunk_heap_allocate(struct ion_heap *heap,
        if (allocated_size > chunk_heap->size - chunk_heap->allocated)
                return -ENOMEM;
 
-       table = kzalloc(sizeof(struct sg_table), GFP_KERNEL);
+       table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
        if (!table)
                return -ENOMEM;
        ret = sg_alloc_table(table, num_chunks, GFP_KERNEL);
index c92363356ae142292fdcc29f0e1ebd758ff49e8c..0663a7fbfa6045909be58a636f5893cb18b30315 100644 (file)
@@ -166,7 +166,7 @@ static int ion_system_heap_allocate(struct ion_heap *heap,
                max_order = info->order;
                i++;
        }
-       table = kzalloc(sizeof(struct sg_table), GFP_KERNEL);
+       table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
        if (!table)
                goto err;
 
@@ -356,7 +356,7 @@ static int ion_system_contig_heap_allocate(struct ion_heap *heap,
        for (i = len >> PAGE_SHIFT; i < (1 << order); i++)
                __free_page(page + i);
 
-       table = kzalloc(sizeof(struct sg_table), GFP_KERNEL);
+       table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
        if (!table) {
                ret = -ENOMEM;
                goto out;