public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* staging: android: ion checkpatch.pl cleanups
@ 2014-08-12 16:17 Phong Tran
  2014-08-12 16:17 ` [PATCH 1/5] staging: android: ion: ion.c Fix checkpatch warning Phong Tran
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Phong Tran @ 2014-08-12 16:17 UTC (permalink / raw)
  To: gregkh; +Cc: swetland, ccross, linux-kernel, devel

Hi Greg,

These patches fix checkpatch warning.
Apply for staging-next branch.

Regards,
Phong.


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

* [PATCH 1/5] staging: android: ion: ion.c Fix checkpatch warning
  2014-08-12 16:17 staging: android: ion checkpatch.pl cleanups Phong Tran
@ 2014-08-12 16:17 ` Phong Tran
  2014-08-12 16:37   ` [RFC PATCH] checkpatch: Warn on patch subjects with "checkpatch" Joe Perches
  2014-08-12 16:17 ` [PATCH 2/5] staging: android: ion: ion_chunk_heap.c Fix checkpatch warning Phong Tran
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Phong Tran @ 2014-08-12 16:17 UTC (permalink / raw)
  To: gregkh; +Cc: swetland, ccross, linux-kernel, devel, Phong Tran

This patch fix the coding style

- Add a new line after variable declaration
- Remove return of void fuction

Tested by compilation

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/staging/android/ion/ion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 2703609..56604f4 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -805,6 +805,7 @@ struct ion_client *ion_client_create(struct ion_device *dev,
 						client, &debug_client_fops);
 	if (!client->debug_root) {
 		char buf[256], *path;
+
 		path = dentry_path(dev->clients_debug_root, buf, 256);
 		pr_err("Failed to create client debugfs at %s/%s\n",
 			path, client->display_name);
@@ -1056,7 +1057,6 @@ static void *ion_dma_buf_kmap(struct dma_buf *dmabuf, unsigned long offset)
 static void ion_dma_buf_kunmap(struct dma_buf *dmabuf, unsigned long offset,
 			       void *ptr)
 {
-	return;
 }
 
 static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, size_t start,
-- 
1.9.3


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

* [PATCH 2/5] staging: android: ion: ion_chunk_heap.c Fix checkpatch warning
  2014-08-12 16:17 staging: android: ion checkpatch.pl cleanups Phong Tran
  2014-08-12 16:17 ` [PATCH 1/5] staging: android: ion: ion.c Fix checkpatch warning Phong Tran
@ 2014-08-12 16:17 ` Phong Tran
  2014-08-12 16:17 ` [PATCH 3/5] staging: android: ion: ion_system_heap.c " Phong Tran
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Phong Tran @ 2014-08-12 16:17 UTC (permalink / raw)
  To: gregkh; +Cc: swetland, ccross, linux-kernel, devel, Phong Tran

This patch fix coding style

- Remove return of void function

Tested by compilation

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/staging/android/ion/ion_chunk_heap.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c
index 9c3e49a..3e6ec2e 100644
--- a/drivers/staging/android/ion/ion_chunk_heap.c
+++ b/drivers/staging/android/ion/ion_chunk_heap.c
@@ -126,7 +126,6 @@ static struct sg_table *ion_chunk_heap_map_dma(struct ion_heap *heap,
 static void ion_chunk_heap_unmap_dma(struct ion_heap *heap,
 				     struct ion_buffer *buffer)
 {
-	return;
 }
 
 static struct ion_heap_ops chunk_heap_ops = {
-- 
1.9.3


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

* [PATCH 3/5] staging: android: ion: ion_system_heap.c Fix checkpatch warning
  2014-08-12 16:17 staging: android: ion checkpatch.pl cleanups Phong Tran
  2014-08-12 16:17 ` [PATCH 1/5] staging: android: ion: ion.c Fix checkpatch warning Phong Tran
  2014-08-12 16:17 ` [PATCH 2/5] staging: android: ion: ion_chunk_heap.c Fix checkpatch warning Phong Tran
@ 2014-08-12 16:17 ` Phong Tran
  2014-08-13 10:38   ` Dan Carpenter
  2014-08-12 16:17 ` [PATCH 4/5] staging: android: ion: ion_carveout_heap.c " Phong Tran
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Phong Tran @ 2014-08-12 16:17 UTC (permalink / raw)
  To: gregkh; +Cc: swetland, ccross, linux-kernel, devel, Phong Tran

This patch fix coding rule

- Remove return of void function

Tested by compilation

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/staging/android/ion/ion_system_heap.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
index 6b77c51..da2a63c 100644
--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -205,7 +205,6 @@ static struct sg_table *ion_system_heap_map_dma(struct ion_heap *heap,
 static void ion_system_heap_unmap_dma(struct ion_heap *heap,
 				      struct ion_buffer *buffer)
 {
-	return;
 }
 
 static int ion_system_heap_shrink(struct ion_heap *heap, gfp_t gfp_mask,
-- 
1.9.3


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

* [PATCH 4/5] staging: android: ion: ion_carveout_heap.c Fix checkpatch warning
  2014-08-12 16:17 staging: android: ion checkpatch.pl cleanups Phong Tran
                   ` (2 preceding siblings ...)
  2014-08-12 16:17 ` [PATCH 3/5] staging: android: ion: ion_system_heap.c " Phong Tran
@ 2014-08-12 16:17 ` Phong Tran
  2014-08-12 16:17 ` [PATCH 5/5] staging: android: ion: ion_dummy_driver.c " Phong Tran
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Phong Tran @ 2014-08-12 16:17 UTC (permalink / raw)
  To: gregkh; +Cc: swetland, ccross, linux-kernel, devel, Phong Tran

This patch fix coding style

- Remove return of void function

Tested by compilation

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/staging/android/ion/ion_carveout_heap.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_carveout_heap.c b/drivers/staging/android/ion/ion_carveout_heap.c
index dcb6f21..9156d82 100644
--- a/drivers/staging/android/ion/ion_carveout_heap.c
+++ b/drivers/staging/android/ion/ion_carveout_heap.c
@@ -133,7 +133,6 @@ static struct sg_table *ion_carveout_heap_map_dma(struct ion_heap *heap,
 static void ion_carveout_heap_unmap_dma(struct ion_heap *heap,
 					struct ion_buffer *buffer)
 {
-	return;
 }
 
 static struct ion_heap_ops carveout_heap_ops = {
-- 
1.9.3


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

* [PATCH 5/5] staging: android: ion: ion_dummy_driver.c Fix checkpatch warning
  2014-08-12 16:17 staging: android: ion checkpatch.pl cleanups Phong Tran
                   ` (3 preceding siblings ...)
  2014-08-12 16:17 ` [PATCH 4/5] staging: android: ion: ion_carveout_heap.c " Phong Tran
@ 2014-08-12 16:17 ` Phong Tran
  2014-08-13 13:09 ` [Patch V2 1/3] staging: android: ion: ion_dummy_driver.c Fix coding style Phong Tran
  2014-08-13 13:37 ` [PATCH V3 1/3] staging: android: ion: ion_dummy_driver.c Replace kzalloc() by kcalloc() Phong Tran
  6 siblings, 0 replies; 16+ messages in thread
From: Phong Tran @ 2014-08-12 16:17 UTC (permalink / raw)
  To: gregkh; +Cc: swetland, ccross, linux-kernel, devel, Phong Tran

This patch fix coding style

- Replace kzalloc() by kcalloc()
- Remove return of void function

Tested by compilation

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/staging/android/ion/ion_dummy_driver.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/android/ion/ion_dummy_driver.c b/drivers/staging/android/ion/ion_dummy_driver.c
index 3a45e79..f3ea1c3 100644
--- a/drivers/staging/android/ion/ion_dummy_driver.c
+++ b/drivers/staging/android/ion/ion_dummy_driver.c
@@ -68,7 +68,7 @@ static int __init ion_dummy_init(void)
 	int i, err;
 
 	idev = ion_device_create(NULL);
-	heaps = kzalloc(sizeof(struct ion_heap *) * dummy_ion_pdata.nr,
+	heaps = kcalloc(dummy_ion_pdata.nr, sizeof(struct ion_heap *),
 			GFP_KERNEL);
 	if (!heaps)
 		return -ENOMEM;
@@ -152,7 +152,5 @@ static void __exit ion_dummy_exit(void)
 				dummy_heaps[ION_HEAP_TYPE_CHUNK].size);
 		chunk_ptr = NULL;
 	}
-
-	return;
 }
 __exitcall(ion_dummy_exit);
-- 
1.9.3


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

* [RFC PATCH] checkpatch: Warn on patch subjects with "checkpatch"
  2014-08-12 16:17 ` [PATCH 1/5] staging: android: ion: ion.c Fix checkpatch warning Phong Tran
@ 2014-08-12 16:37   ` Joe Perches
  2014-08-13 10:37     ` Dan Carpenter
  0 siblings, 1 reply; 16+ messages in thread
From: Joe Perches @ 2014-08-12 16:37 UTC (permalink / raw)
  To: Andrew Morton; +Cc: gregkh, swetland, ccross, linux-kernel, devel, Phong Tran

I think patch subject lines with "checkpatch" in
them are almost never really useful.

Maybe a new checkpatch test to see if a subject line
is perhaps less than informational should be added.

Something like:
---
 scripts/checkpatch.pl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 31a731e..a690515 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2048,6 +2048,13 @@ sub process {
 			$in_commit_log = 0;
 		}
 
+# Check patch subject lines for "checkpatch" (but not checkpatch:)
+		if ($in_header_lines &&
+		    $line =~ /^\s*subject:.*\bcheckpatch(?!(?:\.pl)?:)\b/i) {
+			WARN("BAD_PATCH_SUBJECT",
+			     "Patch subjects with 'checkpatch' are not generally useful.  Describe the change, not the tool that suggests the change.\n" . $herecurr);
+		}
+
 # Check signature styles
 		if (!$in_header_lines &&
 		    $line =~ /^(\s*)([a-z0-9_-]+by:|$signature_tags)(\s*)(.*)/i) {



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

* Re: [RFC PATCH] checkpatch: Warn on patch subjects with "checkpatch"
  2014-08-12 16:37   ` [RFC PATCH] checkpatch: Warn on patch subjects with "checkpatch" Joe Perches
@ 2014-08-13 10:37     ` Dan Carpenter
  0 siblings, 0 replies; 16+ messages in thread
From: Dan Carpenter @ 2014-08-13 10:37 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andrew Morton, devel, Phong Tran, gregkh, linux-kernel, ccross,
	swetland

The subject will just get changed to "Coding style".

regards,
dan carpenter


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

* Re: [PATCH 3/5] staging: android: ion: ion_system_heap.c Fix checkpatch warning
  2014-08-12 16:17 ` [PATCH 3/5] staging: android: ion: ion_system_heap.c " Phong Tran
@ 2014-08-13 10:38   ` Dan Carpenter
  0 siblings, 0 replies; 16+ messages in thread
From: Dan Carpenter @ 2014-08-13 10:38 UTC (permalink / raw)
  To: Phong Tran; +Cc: gregkh, devel, swetland, linux-kernel, ccross

Just fold all these "- return;" patches into one patch.

regards,
dan carpenter


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

* [Patch V2 1/3] staging: android: ion: ion_dummy_driver.c Fix coding style
  2014-08-12 16:17 staging: android: ion checkpatch.pl cleanups Phong Tran
                   ` (4 preceding siblings ...)
  2014-08-12 16:17 ` [PATCH 5/5] staging: android: ion: ion_dummy_driver.c " Phong Tran
@ 2014-08-13 13:09 ` Phong Tran
  2014-08-13 13:09   ` [Patch V2 2/3] staging: android: ion: ion.c " Phong Tran
                     ` (2 more replies)
  2014-08-13 13:37 ` [PATCH V3 1/3] staging: android: ion: ion_dummy_driver.c Replace kzalloc() by kcalloc() Phong Tran
  6 siblings, 3 replies; 16+ messages in thread
From: Phong Tran @ 2014-08-13 13:09 UTC (permalink / raw)
  To: gregkh
  Cc: ccross, swetland, linux-kernel, devel, joe, dan.carpenter, akpm,
	Phong Tran

This patch fix checkpatch.pl warning
- Replace kzalloc() by kcalloc()
Tested by compilation.

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/staging/android/ion/ion_dummy_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_dummy_driver.c b/drivers/staging/android/ion/ion_dummy_driver.c
index 3a45e79..6d0a38a 100644
--- a/drivers/staging/android/ion/ion_dummy_driver.c
+++ b/drivers/staging/android/ion/ion_dummy_driver.c
@@ -68,7 +68,7 @@ static int __init ion_dummy_init(void)
 	int i, err;
 
 	idev = ion_device_create(NULL);
-	heaps = kzalloc(sizeof(struct ion_heap *) * dummy_ion_pdata.nr,
+	heaps = kcalloc(dummy_ion_pdata.nr, sizeof(struct ion_heap *),
 			GFP_KERNEL);
 	if (!heaps)
 		return -ENOMEM;
-- 
1.9.3


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

* [Patch V2 2/3] staging: android: ion: ion.c Fix coding style
  2014-08-13 13:09 ` [Patch V2 1/3] staging: android: ion: ion_dummy_driver.c Fix coding style Phong Tran
@ 2014-08-13 13:09   ` Phong Tran
  2014-08-13 13:09   ` [Patch V2 3/3] staging: android: ion: " Phong Tran
  2014-08-13 13:15   ` [Patch V2 1/3] staging: android: ion: ion_dummy_driver.c " Dan Carpenter
  2 siblings, 0 replies; 16+ messages in thread
From: Phong Tran @ 2014-08-13 13:09 UTC (permalink / raw)
  To: gregkh
  Cc: ccross, swetland, linux-kernel, devel, joe, dan.carpenter, akpm,
	Phong Tran

This patch fix checkpatch.pl warning
- Add a new line after decleration
Tested by compilation.

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/staging/android/ion/ion.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 2703609..cad76ae 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -805,6 +805,7 @@ struct ion_client *ion_client_create(struct ion_device *dev,
 						client, &debug_client_fops);
 	if (!client->debug_root) {
 		char buf[256], *path;
+
 		path = dentry_path(dev->clients_debug_root, buf, 256);
 		pr_err("Failed to create client debugfs at %s/%s\n",
 			path, client->display_name);
-- 
1.9.3


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

* [Patch V2 3/3] staging: android: ion: Fix coding style
  2014-08-13 13:09 ` [Patch V2 1/3] staging: android: ion: ion_dummy_driver.c Fix coding style Phong Tran
  2014-08-13 13:09   ` [Patch V2 2/3] staging: android: ion: ion.c " Phong Tran
@ 2014-08-13 13:09   ` Phong Tran
  2014-08-13 13:15   ` [Patch V2 1/3] staging: android: ion: ion_dummy_driver.c " Dan Carpenter
  2 siblings, 0 replies; 16+ messages in thread
From: Phong Tran @ 2014-08-13 13:09 UTC (permalink / raw)
  To: gregkh
  Cc: ccross, swetland, linux-kernel, devel, joe, dan.carpenter, akpm,
	Phong Tran

This patch fix checkpatch.pl warning
- Remove the return of void function
Tested by compilation.

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/staging/android/ion/ion.c               | 1 -
 drivers/staging/android/ion/ion_carveout_heap.c | 1 -
 drivers/staging/android/ion/ion_chunk_heap.c    | 1 -
 drivers/staging/android/ion/ion_dummy_driver.c  | 2 --
 drivers/staging/android/ion/ion_system_heap.c   | 1 -
 5 files changed, 6 deletions(-)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index cad76ae..56604f4 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -1057,7 +1057,6 @@ static void *ion_dma_buf_kmap(struct dma_buf *dmabuf, unsigned long offset)
 static void ion_dma_buf_kunmap(struct dma_buf *dmabuf, unsigned long offset,
 			       void *ptr)
 {
-	return;
 }
 
 static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, size_t start,
diff --git a/drivers/staging/android/ion/ion_carveout_heap.c b/drivers/staging/android/ion/ion_carveout_heap.c
index dcb6f21..9156d82 100644
--- a/drivers/staging/android/ion/ion_carveout_heap.c
+++ b/drivers/staging/android/ion/ion_carveout_heap.c
@@ -133,7 +133,6 @@ static struct sg_table *ion_carveout_heap_map_dma(struct ion_heap *heap,
 static void ion_carveout_heap_unmap_dma(struct ion_heap *heap,
 					struct ion_buffer *buffer)
 {
-	return;
 }
 
 static struct ion_heap_ops carveout_heap_ops = {
diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c
index 9c3e49a..3e6ec2e 100644
--- a/drivers/staging/android/ion/ion_chunk_heap.c
+++ b/drivers/staging/android/ion/ion_chunk_heap.c
@@ -126,7 +126,6 @@ static struct sg_table *ion_chunk_heap_map_dma(struct ion_heap *heap,
 static void ion_chunk_heap_unmap_dma(struct ion_heap *heap,
 				     struct ion_buffer *buffer)
 {
-	return;
 }
 
 static struct ion_heap_ops chunk_heap_ops = {
diff --git a/drivers/staging/android/ion/ion_dummy_driver.c b/drivers/staging/android/ion/ion_dummy_driver.c
index 6d0a38a..f3ea1c3 100644
--- a/drivers/staging/android/ion/ion_dummy_driver.c
+++ b/drivers/staging/android/ion/ion_dummy_driver.c
@@ -152,7 +152,5 @@ static void __exit ion_dummy_exit(void)
 				dummy_heaps[ION_HEAP_TYPE_CHUNK].size);
 		chunk_ptr = NULL;
 	}
-
-	return;
 }
 __exitcall(ion_dummy_exit);
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
index 6b77c51..da2a63c 100644
--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -205,7 +205,6 @@ static struct sg_table *ion_system_heap_map_dma(struct ion_heap *heap,
 static void ion_system_heap_unmap_dma(struct ion_heap *heap,
 				      struct ion_buffer *buffer)
 {
-	return;
 }
 
 static int ion_system_heap_shrink(struct ion_heap *heap, gfp_t gfp_mask,
-- 
1.9.3


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

* Re: [Patch V2 1/3] staging: android: ion: ion_dummy_driver.c Fix coding style
  2014-08-13 13:09 ` [Patch V2 1/3] staging: android: ion: ion_dummy_driver.c Fix coding style Phong Tran
  2014-08-13 13:09   ` [Patch V2 2/3] staging: android: ion: ion.c " Phong Tran
  2014-08-13 13:09   ` [Patch V2 3/3] staging: android: ion: " Phong Tran
@ 2014-08-13 13:15   ` Dan Carpenter
  2 siblings, 0 replies; 16+ messages in thread
From: Dan Carpenter @ 2014-08-13 13:15 UTC (permalink / raw)
  To: Phong Tran; +Cc: gregkh, devel, swetland, linux-kernel, ccross, joe, akpm

On Wed, Aug 13, 2014 at 08:09:38PM +0700, Phong Tran wrote:
> This patch fix checkpatch.pl warning
> - Replace kzalloc() by kcalloc()
> Tested by compilation.
> 

The patches look ok, but can you resend with better subject lines?
kzalloc() -> kcalloc().
add blank.
remove returns.

Something like that.

regards,
dan carpenter


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

* [PATCH V3 1/3] staging: android: ion: ion_dummy_driver.c Replace kzalloc() by kcalloc()
  2014-08-12 16:17 staging: android: ion checkpatch.pl cleanups Phong Tran
                   ` (5 preceding siblings ...)
  2014-08-13 13:09 ` [Patch V2 1/3] staging: android: ion: ion_dummy_driver.c Fix coding style Phong Tran
@ 2014-08-13 13:37 ` Phong Tran
  2014-08-13 13:37   ` [PATCH V3 2/3] staging: android: ion: ion.c Add a new blank line after decleration Phong Tran
  2014-08-13 13:37   ` [PATCH V3 3/3] staging: android: ion: Remove redundant return of void function Phong Tran
  6 siblings, 2 replies; 16+ messages in thread
From: Phong Tran @ 2014-08-13 13:37 UTC (permalink / raw)
  To: gregkh
  Cc: ccross, swetland, linux-kernel, devel, joe, dan.carpenter, akpm,
	Phong Tran

This patch fix checkpatch.pl warning
Tested by compilation only.

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/staging/android/ion/ion_dummy_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_dummy_driver.c b/drivers/staging/android/ion/ion_dummy_driver.c
index 3a45e79..6d0a38a 100644
--- a/drivers/staging/android/ion/ion_dummy_driver.c
+++ b/drivers/staging/android/ion/ion_dummy_driver.c
@@ -68,7 +68,7 @@ static int __init ion_dummy_init(void)
 	int i, err;
 
 	idev = ion_device_create(NULL);
-	heaps = kzalloc(sizeof(struct ion_heap *) * dummy_ion_pdata.nr,
+	heaps = kcalloc(dummy_ion_pdata.nr, sizeof(struct ion_heap *),
 			GFP_KERNEL);
 	if (!heaps)
 		return -ENOMEM;
-- 
1.9.3


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

* [PATCH V3 2/3] staging: android: ion: ion.c Add a new blank line after decleration
  2014-08-13 13:37 ` [PATCH V3 1/3] staging: android: ion: ion_dummy_driver.c Replace kzalloc() by kcalloc() Phong Tran
@ 2014-08-13 13:37   ` Phong Tran
  2014-08-13 13:37   ` [PATCH V3 3/3] staging: android: ion: Remove redundant return of void function Phong Tran
  1 sibling, 0 replies; 16+ messages in thread
From: Phong Tran @ 2014-08-13 13:37 UTC (permalink / raw)
  To: gregkh
  Cc: ccross, swetland, linux-kernel, devel, joe, dan.carpenter, akpm,
	Phong Tran

This patch fix checkpatch.pl warning
Tested by compilation only.

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/staging/android/ion/ion.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 2703609..cad76ae 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -805,6 +805,7 @@ struct ion_client *ion_client_create(struct ion_device *dev,
 						client, &debug_client_fops);
 	if (!client->debug_root) {
 		char buf[256], *path;
+
 		path = dentry_path(dev->clients_debug_root, buf, 256);
 		pr_err("Failed to create client debugfs at %s/%s\n",
 			path, client->display_name);
-- 
1.9.3


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

* [PATCH V3 3/3] staging: android: ion: Remove redundant return of void function
  2014-08-13 13:37 ` [PATCH V3 1/3] staging: android: ion: ion_dummy_driver.c Replace kzalloc() by kcalloc() Phong Tran
  2014-08-13 13:37   ` [PATCH V3 2/3] staging: android: ion: ion.c Add a new blank line after decleration Phong Tran
@ 2014-08-13 13:37   ` Phong Tran
  1 sibling, 0 replies; 16+ messages in thread
From: Phong Tran @ 2014-08-13 13:37 UTC (permalink / raw)
  To: gregkh
  Cc: ccross, swetland, linux-kernel, devel, joe, dan.carpenter, akpm,
	Phong Tran

This patch fix checkpatch.pl warning
Tested by compilation only.

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/staging/android/ion/ion.c               | 1 -
 drivers/staging/android/ion/ion_carveout_heap.c | 1 -
 drivers/staging/android/ion/ion_chunk_heap.c    | 1 -
 drivers/staging/android/ion/ion_dummy_driver.c  | 2 --
 drivers/staging/android/ion/ion_system_heap.c   | 1 -
 5 files changed, 6 deletions(-)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index cad76ae..56604f4 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -1057,7 +1057,6 @@ static void *ion_dma_buf_kmap(struct dma_buf *dmabuf, unsigned long offset)
 static void ion_dma_buf_kunmap(struct dma_buf *dmabuf, unsigned long offset,
 			       void *ptr)
 {
-	return;
 }
 
 static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, size_t start,
diff --git a/drivers/staging/android/ion/ion_carveout_heap.c b/drivers/staging/android/ion/ion_carveout_heap.c
index dcb6f21..9156d82 100644
--- a/drivers/staging/android/ion/ion_carveout_heap.c
+++ b/drivers/staging/android/ion/ion_carveout_heap.c
@@ -133,7 +133,6 @@ static struct sg_table *ion_carveout_heap_map_dma(struct ion_heap *heap,
 static void ion_carveout_heap_unmap_dma(struct ion_heap *heap,
 					struct ion_buffer *buffer)
 {
-	return;
 }
 
 static struct ion_heap_ops carveout_heap_ops = {
diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c
index 9c3e49a..3e6ec2e 100644
--- a/drivers/staging/android/ion/ion_chunk_heap.c
+++ b/drivers/staging/android/ion/ion_chunk_heap.c
@@ -126,7 +126,6 @@ static struct sg_table *ion_chunk_heap_map_dma(struct ion_heap *heap,
 static void ion_chunk_heap_unmap_dma(struct ion_heap *heap,
 				     struct ion_buffer *buffer)
 {
-	return;
 }
 
 static struct ion_heap_ops chunk_heap_ops = {
diff --git a/drivers/staging/android/ion/ion_dummy_driver.c b/drivers/staging/android/ion/ion_dummy_driver.c
index 6d0a38a..f3ea1c3 100644
--- a/drivers/staging/android/ion/ion_dummy_driver.c
+++ b/drivers/staging/android/ion/ion_dummy_driver.c
@@ -152,7 +152,5 @@ static void __exit ion_dummy_exit(void)
 				dummy_heaps[ION_HEAP_TYPE_CHUNK].size);
 		chunk_ptr = NULL;
 	}
-
-	return;
 }
 __exitcall(ion_dummy_exit);
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
index 6b77c51..da2a63c 100644
--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -205,7 +205,6 @@ static struct sg_table *ion_system_heap_map_dma(struct ion_heap *heap,
 static void ion_system_heap_unmap_dma(struct ion_heap *heap,
 				      struct ion_buffer *buffer)
 {
-	return;
 }
 
 static int ion_system_heap_shrink(struct ion_heap *heap, gfp_t gfp_mask,
-- 
1.9.3


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

end of thread, other threads:[~2014-08-13 13:39 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-12 16:17 staging: android: ion checkpatch.pl cleanups Phong Tran
2014-08-12 16:17 ` [PATCH 1/5] staging: android: ion: ion.c Fix checkpatch warning Phong Tran
2014-08-12 16:37   ` [RFC PATCH] checkpatch: Warn on patch subjects with "checkpatch" Joe Perches
2014-08-13 10:37     ` Dan Carpenter
2014-08-12 16:17 ` [PATCH 2/5] staging: android: ion: ion_chunk_heap.c Fix checkpatch warning Phong Tran
2014-08-12 16:17 ` [PATCH 3/5] staging: android: ion: ion_system_heap.c " Phong Tran
2014-08-13 10:38   ` Dan Carpenter
2014-08-12 16:17 ` [PATCH 4/5] staging: android: ion: ion_carveout_heap.c " Phong Tran
2014-08-12 16:17 ` [PATCH 5/5] staging: android: ion: ion_dummy_driver.c " Phong Tran
2014-08-13 13:09 ` [Patch V2 1/3] staging: android: ion: ion_dummy_driver.c Fix coding style Phong Tran
2014-08-13 13:09   ` [Patch V2 2/3] staging: android: ion: ion.c " Phong Tran
2014-08-13 13:09   ` [Patch V2 3/3] staging: android: ion: " Phong Tran
2014-08-13 13:15   ` [Patch V2 1/3] staging: android: ion: ion_dummy_driver.c " Dan Carpenter
2014-08-13 13:37 ` [PATCH V3 1/3] staging: android: ion: ion_dummy_driver.c Replace kzalloc() by kcalloc() Phong Tran
2014-08-13 13:37   ` [PATCH V3 2/3] staging: android: ion: ion.c Add a new blank line after decleration Phong Tran
2014-08-13 13:37   ` [PATCH V3 3/3] staging: android: ion: Remove redundant return of void function Phong Tran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox