Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1578560 > unrolled thread

[PATCH] staging: android: ion: fix coding style issue

Started by"Youngdo, Lee" <oss.ydlee@gmail.com>
First post2017-02-10 16:40 +0100
Last post2017-02-10 16:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: android: ion: fix coding style issue "Youngdo, Lee" <oss.ydlee@gmail.com> - 2017-02-10 16:40 +0100

#1578560 — [PATCH] staging: android: ion: fix coding style issue

From"Youngdo, Lee" <oss.ydlee@gmail.com>
Date2017-02-10 16:40 +0100
Subject[PATCH] staging: android: ion: fix coding style issue
Message-ID<t9lsJ-5dQ-13@gated-at.bofh.it>
Replaced sizeof(struct foo) into sizeof(*ptr), found by checkpatch.pl.

Signed-off-by: Youngdo, Lee <oss.ydlee@gmail.com>
---
 drivers/staging/android/ion/ion_cma_heap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c
index 22b9582..6c40685 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -55,7 +55,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
 	if (align > PAGE_SIZE)
 		return -EINVAL;
 
-	info = kzalloc(sizeof(struct ion_cma_buffer_info), GFP_KERNEL);
+	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (!info)
 		return -ENOMEM;
 
@@ -67,7 +67,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
 		goto err;
 	}
 
-	info->table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
+	info->table = kmalloc(sizeof(*info->table), GFP_KERNEL);
 	if (!info->table)
 		goto free_mem;
 
@@ -140,7 +140,7 @@ struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *data)
 {
 	struct ion_cma_heap *cma_heap;
 
-	cma_heap = kzalloc(sizeof(struct ion_cma_heap), GFP_KERNEL);
+	cma_heap = kzalloc(sizeof(*cma_heap), GFP_KERNEL);
 
 	if (!cma_heap)
 		return ERR_PTR(-ENOMEM);
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web