mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
staging: android: ion: Improve memory alloc style
Use variable name instead of structure name to get size of memory to allocate as proposed by checkpatch.pl Signed-off-by: Aliaksei Karaliou <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
1dbc269e95
commit
d567b0fe2d
1 changed files with 3 additions and 3 deletions
|
|
@ -153,7 +153,7 @@ static int ion_system_heap_allocate(struct ion_heap *heap,
|
|||
max_order = compound_order(page);
|
||||
i++;
|
||||
}
|
||||
table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
|
||||
table = kmalloc(sizeof(*table), GFP_KERNEL);
|
||||
if (!table)
|
||||
goto free_pages;
|
||||
|
||||
|
|
@ -383,7 +383,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 = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
|
||||
table = kmalloc(sizeof(*table), GFP_KERNEL);
|
||||
if (!table) {
|
||||
ret = -ENOMEM;
|
||||
goto free_pages;
|
||||
|
|
@ -433,7 +433,7 @@ static struct ion_heap *__ion_system_contig_heap_create(void)
|
|||
{
|
||||
struct ion_heap *heap;
|
||||
|
||||
heap = kzalloc(sizeof(struct ion_heap), GFP_KERNEL);
|
||||
heap = kzalloc(sizeof(*heap), GFP_KERNEL);
|
||||
if (!heap)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
heap->ops = &kmalloc_ops;
|
||||
|
|
|
|||
Loading…
Reference in a new issue