diff options
author | Aliaksei Karaliou <akaraliou.dev@gmail.com> | 2017-06-13 13:06:21 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-14 12:37:22 +0200 |
commit | d567b0fe2d63aaf5814f1b488a1b05db53f1849e (patch) | |
tree | 0db7c82bdee8fd61e2db087ed25b774f9294e8b9 /drivers | |
parent | 1dbc269e95f34cc071c33db6cd02a5f5f746226e (diff) | |
download | op-kernel-dev-d567b0fe2d63aaf5814f1b488a1b05db53f1849e.zip op-kernel-dev-d567b0fe2d63aaf5814f1b488a1b05db53f1849e.tar.gz |
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 <akaraliou.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/android/ion/ion_system_heap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index c50f2d9..5964bf2 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -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; |