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


Groups > linux.kernel > #1717938

[PATCH] drivers: staging: android: Fix style/formatting issues

From Nick Fox <fox.nicholas.j@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] drivers: staging: android: Fix style/formatting issues
Date 2017-08-23 03:10 +0200
Message-ID <uhslc-27L-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Fix two issues reported by checkpatch. The first removes an extra
blank line, the second changes an argument to kmalloc(). Original
checkpatch output is below:

ion/ion_cma_heap.c:34: CHECK: Please don't use multiple blank lines
ion/ion_cma_heap.c:49: CHECK: Prefer kmalloc(sizeof(*table)...) over kmalloc(sizeof(struct sg_table)...)
total: 0 errors, 0 warnings, 2 checks, 128 lines checked

Signed-off-by: Nick Fox <fox.nicholas.j@gmail.com>
---
 drivers/staging/android/ion/ion_cma_heap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c
index a0949bc0dcf4..bb2c1449cbcf 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -31,7 +31,6 @@ struct ion_cma_heap {
 
 #define to_cma_heap(x) container_of(x, struct ion_cma_heap, heap)
 
-
 /* ION CMA heap operations functions */
 static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
 			    unsigned long len,
@@ -46,7 +45,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;
 
-- 
2.13.5

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] drivers: staging: android: Fix style/formatting issues Nick Fox <fox.nicholas.j@gmail.com> - 2017-08-23 03:10 +0200
  Re: [PATCH] drivers: staging: android: Fix style/formatting issues Greg KH <greg@kroah.com> - 2017-08-23 03:40 +0200
  [PATCH 1/2] staging: android: ion: Remove extra line (checkpatch) Nick Fox <fox.nicholas.j@gmail.com> - 2017-08-23 05:00 +0200
    [PATCH 2/2] staging: android: ion: Change argument to kmalloc (checkpatch) Nick Fox <fox.nicholas.j@gmail.com> - 2017-08-23 05:00 +0200
      Re: [PATCH 2/2] staging: android: ion: Change argument to kmalloc  (checkpatch) Greg KH <greg@kroah.com> - 2017-08-23 07:40 +0200
        Re: [PATCH 2/2] staging: android: ion: Change argument to kmalloc  (checkpatch) Greg KH <greg@kroah.com> - 2017-08-24 01:20 +0200
    Re: [PATCH 1/2] staging: android: ion: Remove extra line (checkpatch) Greg KH <greg@kroah.com> - 2017-08-23 07:40 +0200

csiph-web