linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [PATCH] staging: android: ion: heap: Improve code style
       [not found] <20170613083950.GA21914@kroah.com>
@ 2017-06-13 10:06 ` Aliaksei Karaliou
  2017-06-13 10:06 ` [PATCH v2] staging: android: ion: Improve memory alloc style Aliaksei Karaliou
  1 sibling, 0 replies; 2+ messages in thread
From: Aliaksei Karaliou @ 2017-06-13 10:06 UTC (permalink / raw)
  To: Sumit Semwal; +Cc: Aliaksei Karaliou, Laura Abbott, devel, linux-kernel

Sorry for that and thank you for reply.
Regarding scripts/get_maintainer.pl, it seems that trying to avoid
disturbing too much people it turned out vice versa. And it was wrong
idea to ignoring vger mailing list since I need this patch to be in public.

Best regards,
Aliaksei.

Aliaksei Karaliou (1):
  staging: android: ion: Improve memory alloc style

 drivers/staging/android/ion/ion_system_heap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH v2] staging: android: ion: Improve memory alloc style
       [not found] <20170613083950.GA21914@kroah.com>
  2017-06-13 10:06 ` [PATCH] staging: android: ion: heap: Improve code style Aliaksei Karaliou
@ 2017-06-13 10:06 ` Aliaksei Karaliou
  1 sibling, 0 replies; 2+ messages in thread
From: Aliaksei Karaliou @ 2017-06-13 10:06 UTC (permalink / raw)
  To: Sumit Semwal, Laura Abbott; +Cc: Aliaksei Karaliou, devel, linux-kernel

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>
---
 drivers/staging/android/ion/ion_system_heap.c | 6 +++---
 1 file 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;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-13 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20170613083950.GA21914@kroah.com>
2017-06-13 10:06 ` [PATCH] staging: android: ion: heap: Improve code style Aliaksei Karaliou
2017-06-13 10:06 ` [PATCH v2] staging: android: ion: Improve memory alloc style Aliaksei Karaliou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).