From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753230AbdFMKHy (ORCPT ); Tue, 13 Jun 2017 06:07:54 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34032 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752608AbdFMKHv (ORCPT ); Tue, 13 Jun 2017 06:07:51 -0400 From: Aliaksei Karaliou To: Sumit Semwal , Laura Abbott Cc: Aliaksei Karaliou , 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 Message-Id: <1497348381-6335-2-git-send-email-akaraliou.dev@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1497348381-6335-1-git-send-email-akaraliou.dev@gmail.com> References: <1497348381-6335-1-git-send-email-akaraliou.dev@gmail.com> In-Reply-To: <20170613083950.GA21914@kroah.com> References: <20170613083950.GA21914@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use variable name instead of structure name to get size of memory to allocate as proposed by checkpatch.pl Signed-off-by: Aliaksei Karaliou --- 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