Skip to contentSkip to conversation

Staging: android: ion_cma_heap.c: fix coding style of kmalloc usage

PATCH New Jaya Durga 1 participant 1 message Jun 29, 2017 Staging

lore
Share & tools
lore

Jaya Durga

author
#0 lore raw

PATCH 5/5 Staging: android: ion_cma_heap.c: fix coding style of kmalloc usage

This patch fixes coding style of kmalloc usage
found by checkpatch.pl
CHECK: Prefer kmalloc(sizeof(*table)...) over
kmalloc(sizeof(struct sg_table)...)

---
 drivers/staging/android/ion/ion_cma_heap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/ion/ion_cma_heap.c +1 -1
index a0949bc..5099298 100644
@@ -46,7 +46,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
 	if (!pages)
 		return -ENOMEM;
 
-	table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
+	table = kmalloc(sizeof(*table), GFP_KERNEL);
 	if (!table)
 		goto err;
 
Signature · 1 line
1.9.1