mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 5/5] Staging: android: ion_cma_heap.c: fix coding style of kmalloc usage
@ 2017-06-29  7:34 Jaya Durga
  0 siblings, 0 replies; only message in thread
From: Jaya Durga @ 2017-06-29  7:34 UTC (permalink / raw)
  To: gregkh
  Cc: labbott, sumit.semwal, arve, riandrews, devel, linux-kernel,
	Jaya Durga, Jaya Durga

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

Signed-off-by: Jaya Durga <jayad@cdac.in>
---
 drivers/staging/android/ion/ion_cma_heap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c
index a0949bc..5099298 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -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;
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-29  7:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29  7:34 [PATCH 5/5] Staging: android: ion_cma_heap.c: fix coding style of kmalloc usage Jaya Durga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome