linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aliaksei Karaliou <akaraliou.dev@gmail.com>
To: Sumit Semwal <sumit.semwal@linaro.org>,
	Laura Abbott <labbott@redhat.com>
Cc: Aliaksei Karaliou <akaraliou.dev@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] staging: android: ion: Improve memory alloc style
Date: Tue, 13 Jun 2017 13:06:21 +0300	[thread overview]
Message-ID: <1497348381-6335-2-git-send-email-akaraliou.dev@gmail.com> (raw)
In-Reply-To: <1497348381-6335-1-git-send-email-akaraliou.dev@gmail.com>
In-Reply-To: <20170613083950.GA21914@kroah.com>

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

      parent reply	other threads:[~2017-06-13 10:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497348381-6335-2-git-send-email-akaraliou.dev@gmail.com \
    --to=akaraliou.dev@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sumit.semwal@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).