staging: android: ion checkpatch.pl cleanups
Subsystems (2)
Hi Greg,
These patches fix checkpatch warning.
Apply for staging-next branch.
Regards,
Phong.
PATCH 1/5 staging: android: ion: ion.c Fix checkpatch warning
This patch fix the coding style
- Add a new line after variable declaration
- Remove return of void fuction
Tested by compilation
--- drivers/staging/android/ion/ion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/ion/ion.c +1 -1
@@ -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,
Signature · 1 line
1.9.3
Joe Perches
maintainerRFC PATCH 1/1 checkpatch: Warn on patch subjects with "checkpatch"
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(+)
scripts/checkpatch.pl +7 -0
@@ -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) {
Re: [RFC PATCH] checkpatch: Warn on patch subjects with "checkpatch"
The subject will just get changed to "Coding style".
regards,
dan carpenter
PATCH 2/5 staging: android: ion: ion_chunk_heap.c Fix checkpatch warning
In reply to Phong TranThis patch fix coding style
- Remove return of void function
Tested by compilation
--- drivers/staging/android/ion/ion_chunk_heap.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/android/ion/ion_chunk_heap.c +0 -1
@@ -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 = {
Signature · 1 line
1.9.3
PATCH 3/5 staging: android: ion: ion_system_heap.c Fix checkpatch warning
In reply to Phong TranThis patch fix coding rule
- Remove return of void function
Tested by compilation
--- drivers/staging/android/ion/ion_system_heap.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/android/ion/ion_system_heap.c +0 -1
@@ -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,
Signature · 1 line
1.9.3
Re: [PATCH 3/5] staging: android: ion: ion_system_heap.c Fix checkpatch warning
Just fold all these "- return;" patches into one patch.
regards,
dan carpenter
PATCH 4/5 staging: android: ion: ion_carveout_heap.c Fix checkpatch warning
In reply to Phong TranThis patch fix coding style
- Remove return of void function
Tested by compilation
--- drivers/staging/android/ion/ion_carveout_heap.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/android/ion/ion_carveout_heap.c +0 -1
@@ -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 = {
Signature · 1 line
1.9.3
PATCH 5/5 staging: android: ion: ion_dummy_driver.c Fix checkpatch warning
In reply to Phong TranThis patch fix coding style
- Replace kzalloc() by kcalloc()
- Remove return of void function
Tested by compilation
--- drivers/staging/android/ion/ion_dummy_driver.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/android/ion/ion_dummy_driver.c +1 -3
@@ -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);
Signature · 1 line
1.9.3
PATCH v2 1/3 staging: android: ion: ion_dummy_driver.c Fix coding style
In reply to Phong TranThis patch fix checkpatch.pl warning
- Replace kzalloc() by kcalloc()
Tested by compilation.
--- drivers/staging/android/ion/ion_dummy_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/ion/ion_dummy_driver.c +1 -1
@@ -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 ;
Signature · 1 line
1.9.3
PATCH v2 2/3 staging: android: ion: ion.c Fix coding style
This patch fix checkpatch.pl warning
- Add a new line after decleration
Tested by compilation.
--- drivers/staging/android/ion/ion.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/android/ion/ion.c +1 -0
@@ -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);
Signature · 1 line
1.9.3
PATCH v2 3/3 staging: android: ion: Fix coding style
In reply to Phong TranThis patch fix checkpatch.pl warning
- Remove the return of void function
Tested by compilation.
--- 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(-)
drivers/staging/android/ion/ion.c +0 -1
@@ -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,
drivers/staging/android/ion/ion_carveout_heap.c +0 -1
@@ -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 = {
drivers/staging/android/ion/ion_chunk_heap.c +0 -1
@@ -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 = {
drivers/staging/android/ion/ion_dummy_driver.c +0 -2
@@ -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);
drivers/staging/android/ion/ion_system_heap.c +0 -1
@@ -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,
Signature · 1 line
1.9.3
Re: [Patch V2 1/3] staging: android: ion: ion_dummy_driver.c Fix coding style
In reply to Phong TranQuoted 4 lines · Phong Tran
This patch fix checkpatch.pl warning
- Replacekzalloc()bykcalloc()
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
PATCH v3 1/3 staging: android: ion: ion_dummy_driver.c Replace kzalloc() by kcalloc()
In reply to Phong TranThis patch fix checkpatch.pl warning
Tested by compilation only.
--- drivers/staging/android/ion/ion_dummy_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/ion/ion_dummy_driver.c +1 -1
@@ -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 ;
Signature · 1 line
1.9.3
PATCH v3 2/3 staging: android: ion: ion.c Add a new blank line after decleration
This patch fix checkpatch.pl warning
Tested by compilation only.
--- drivers/staging/android/ion/ion.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/android/ion/ion.c +1 -0
@@ -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);
Signature · 1 line
1.9.3
PATCH v3 3/3 staging: android: ion: Remove redundant return of void function
In reply to Phong TranThis patch fix checkpatch.pl warning
Tested by compilation only.
--- 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(-)
drivers/staging/android/ion/ion.c +0 -1
@@ -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,
drivers/staging/android/ion/ion_carveout_heap.c +0 -1
@@ -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 = {
drivers/staging/android/ion/ion_chunk_heap.c +0 -1
@@ -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 = {
drivers/staging/android/ion/ion_dummy_driver.c +0 -2
@@ -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);
drivers/staging/android/ion/ion_system_heap.c +0 -1
@@ -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,
Signature · 1 line
1.9.3