Skip to contentSkip to conversation

staging : ion : Fix some checkpatch warnings and an error

PATCH RESEND Superseded Daeseok Youn 2 participants 5 messages Feb 10, 2014 – Feb 11, 2014 Staging

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 staging : ion : Fix some checkpatch warnings and an error

Quoted 1 line

From 2b94a20adb53fba1a6a3d2aebfbbc1b708e04f3b Mon Sep 17 00:00:00 2001

From: Daeseok Youn <[email protected]>
Date: Mon, 10 Feb 2014 20:16:50 +0900
Subject: [PATCH] staging : ion : Fix some checkpatch warnings and an error

Warning:
- Unnecessary space after function pointer name
- quoted string split across lines

Error:
- return is not a function, parentheses are not required

---
 drivers/staging/android/ion/ion.c      |    7 +++----
 drivers/staging/android/ion/ion_priv.h |   16 ++++++++--------
 2 files changed, 11 insertions(+), 12 deletions(-)
drivers/staging/android/ion/ion.c +3 -4
index 574066f..f6d8b34 100644
@@ -55,7 +55,7 @@ struct ion_device {
 	struct mutex buffer_lock;
 	struct rw_semaphore lock;
 	struct plist_head heaps;
-	long (*custom_ioctl) (struct ion_client *client, unsigned int cmd,
+	long (*custom_ioctl)(struct ion_client *client, unsigned int cmd,
 			      unsigned long arg);
 	struct rb_root clients;
 	struct dentry *debug_root;
@@ -429,7 +429,7 @@ static bool ion_handle_validate(struct ion_client *client,
 				struct ion_handle *handle)
 {
 	WARN_ON(!mutex_is_locked(&client->lock));
-	return (idr_find(&client->idr, handle->id) == handle);
+	return idr_find(&client->idr, handle->id) == handle;
 }
 
 static int ion_handle_add(struct ion_client *client, struct ion_handle *handle)
@@ -1527,8 +1527,7 @@ void __init ion_reserve(struct ion_platform_data *data)
 						    data->heaps[i].align,
 						    MEMBLOCK_ALLOC_ANYWHERE);
 			if (!paddr) {
-				pr_err("%s: error allocating memblock for "
-				       "heap %d\n",
+				pr_err("%s: error allocating memblock for heap %d\n",
 					__func__, i);
 				continue;
 			}
drivers/staging/android/ion/ion_priv.h +8 -8
index d986739..10f315a 100644
@@ -100,18 +100,18 @@ void ion_buffer_destroy(struct ion_buffer *buffer);
  * map_dma and map_kernel return pointer on success, ERR_PTR on error.
  */
 struct ion_heap_ops {
-	int (*allocate) (struct ion_heap *heap,
+	int (*allocate)(struct ion_heap *heap,
 			 struct ion_buffer *buffer, unsigned long len,
 			 unsigned long align, unsigned long flags);
-	void (*free) (struct ion_buffer *buffer);
-	int (*phys) (struct ion_heap *heap, struct ion_buffer *buffer,
+	void (*free)(struct ion_buffer *buffer);
+	int (*phys)(struct ion_heap *heap, struct ion_buffer *buffer,
 		     ion_phys_addr_t *addr, size_t *len);
-	struct sg_table *(*map_dma) (struct ion_heap *heap,
+	struct sg_table * (*map_dma)(struct ion_heap *heap,
 					struct ion_buffer *buffer);
-	void (*unmap_dma) (struct ion_heap *heap, struct ion_buffer *buffer);
-	void * (*map_kernel) (struct ion_heap *heap, struct ion_buffer *buffer);
-	void (*unmap_kernel) (struct ion_heap *heap, struct ion_buffer *buffer);
-	int (*map_user) (struct ion_heap *mapper, struct ion_buffer *buffer,
+	void (*unmap_dma)(struct ion_heap *heap, struct ion_buffer *buffer);
+	void * (*map_kernel)(struct ion_heap *heap, struct ion_buffer *buffer);
+	void (*unmap_kernel)(struct ion_heap *heap, struct ion_buffer *buffer);
+	int (*map_user)(struct ion_heap *mapper, struct ion_buffer *buffer,
 			 struct vm_area_struct *vma);
 };
 
Signature · 2 lines
1.7.9.5
---
#1 lore raw
Quoted 6 lines · Daeseok Youn

Warning:
- Unnecessary space after function pointer name
- quoted string split across lines

Error:
- return is not a function, parentheses are not required

Hi.

checkpatch issuing either an ERROR or WARNING isn't really relevant to the subject.

This isn't really a resend. It's a different version and so the subject should not say "Resend". Ideally, you send this with a subject like:

[PATCH V2] staging: ion: Whitespace neatening

and if needed again:

[PATCH V3] staging: ion: Whitespace neatening

etc...

and below:

drivers/staging/android/ion/ion.c

Quoted 1 line
drivers/staging/android/ion/ion.c +0 -0

[]

drivers/staging/android/ion/ion.c struct ion_device { · line 59

Quoted 7 lines
drivers/staging/android/ion/ion.c +1 -1
@@ -55,7 +55,7 @@ struct ion_device {
 	struct mutex buffer_lock;
 	struct rw_semaphore lock;
 	struct plist_head heaps;
-	long (*custom_ioctl) (struct ion_client *client, unsigned int cmd,
+	long (*custom_ioctl)(struct ion_client *client, unsigned int cmd,
 			      unsigned long arg);

Please realign the arguments to the open parenthesis like:

	long (*custom_ioctl)(struct ion_client *client, unsigned int cmd,
			     unsigned long arg);

drivers/staging/android/ion/ion_priv.h

Quoted 1 line
drivers/staging/android/ion/ion_priv.h +0 -0

[]

drivers/staging/android/ion/ion_priv.h void ion_buffer_destroy(struct ion_buffer *buffer); · line 105

Quoted 8 lines
drivers/staging/android/ion/ion_priv.h +1 -1
@@ -100,18 +100,18 @@ void ion_buffer_destroy(struct ion_buffer *buffer);
  * map_dma and map_kernel return pointer on success, ERR_PTR on error.
  */
 struct ion_heap_ops {
-	int (*allocate) (struct ion_heap *heap,
+	int (*allocate)(struct ion_heap *heap,
 			 struct ion_buffer *buffer, unsigned long len,
 			 unsigned long align, unsigned long flags);

realignment here too

etc.

#2 lore raw

Hi,

Thanks for review.
If I send this patch again, i will use a subject as you comment.

And alignment issue, my patch line seems to be same with your example.

Daeseok Youn

2014-02-11 1:33 GMT+09:00 Joe Perches <[email protected]>:

Quoted 58 lines · Daeseok Youn
Quoted 7 lines

Warning:
- Unnecessary space after function pointer name
- quoted string split across lines

Error:
- return is not a function, parentheses are not required

Hi.

checkpatch issuing either an ERROR or WARNING isn't really relevant to the subject.

This isn't really a resend. It's a different version and so the subject should not say "Resend". Ideally, you send this with a subject like:

[PATCH V2] staging: ion: Whitespace neatening

and if needed again:

[PATCH V3] staging: ion: Whitespace neatening

etc...

and below:

drivers/staging/android/ion/ion.c

Quoted 1 line
drivers/staging/android/ion/ion.c +0 -0

[]

drivers/staging/android/ion/ion.c struct ion_device { · line 59

Quoted 7 lines
drivers/staging/android/ion/ion.c +1 -1
@@ -55,7 +55,7 @@ struct ion_device {
      struct mutex buffer_lock;
      struct rw_semaphore lock;
      struct plist_head heaps;
-     long (*custom_ioctl) (struct ion_client *client, unsigned int cmd,
+     long (*custom_ioctl)(struct ion_client *client, unsigned int cmd,
                            unsigned long arg);

Please realign the arguments to the open parenthesis like:

long (*custom_ioctl)(struct ion_client *client, unsigned int cmd,
unsigned long arg);

drivers/staging/android/ion/ion_priv.h

Quoted 1 line
drivers/staging/android/ion/ion_priv.h +0 -0

[]

drivers/staging/android/ion/ion_priv.h void ion_buffer_destroy(struct ion_buffer *buffer); · line 105

Quoted 8 lines
drivers/staging/android/ion/ion_priv.h +1 -1
@@ -100,18 +100,18 @@ void ion_buffer_destroy(struct ion_buffer *buffer);
  * map_dma and map_kernel return pointer on success, ERR_PTR on error.
  */
 struct ion_heap_ops {
-     int (*allocate) (struct ion_heap *heap,
+     int (*allocate)(struct ion_heap *heap,
                       struct ion_buffer *buffer, unsigned long len,
                       unsigned long align, unsigned long flags);

realignment here too

etc.

#3 lore raw
Quoted 1 line · DaeSeok Youn

Hi,

Hello.

Quoted 2 lines

Thanks for review.
If I send this patch again, i will use a subject as you comment.

Thanks.

Quoted 1 line

And alignment issue, my patch line seems to be same with your example.

You took out a space from the line with the function pointer but not from the subsequent lines of the arguments.

Quoted 12 lines
Quoted 12 lines

drivers/staging/android/ion/ion.c

Quoted 1 line
drivers/staging/android/ion/ion.c +0 -0

[]

drivers/staging/android/ion/ion.c struct ion_device { · line 59

Quoted 7 lines
drivers/staging/android/ion/ion.c +1 -1
@@ -55,7 +55,7 @@ struct ion_device {
      struct mutex buffer_lock;
      struct rw_semaphore lock;
      struct plist_head heaps;
-     long (*custom_ioctl) (struct ion_client *client, unsigned int cmd,
+     long (*custom_ioctl)(struct ion_client *client, unsigned int cmd,
                            unsigned long arg);

Please realign the arguments to the open parenthesis like:

Quoted 2 lines
Quoted 2 lines

long (*custom_ioctl)(struct ion_client *client, unsigned int cmd,
unsigned long arg);

Your patch has:

	long (*custom_ioctl)(struct ion_client *client, unsigned int cmd,
			      unsigned long arg);

it should be:

	long (*custom_ioctl)(struct ion_client *client, unsigned int cmd,
			     unsigned long arg);

with the "unsigned long arg" aligned immediately after the open parenthesis of the function arguments.

(under the "s" of struct, not the first "t" of struct)

#4 lore raw

Oh.. I see.

My tabstop size is 4 in my editor so I didn't get your comment. Sorry for that.(I know tabs in kernel are 8 char.)

I will re-send fixing alignment as your comment.

Thanks a lot.
Daeseok Youn

2014-02-11 9:20 GMT+09:00 Joe Perches <[email protected]>:

Quoted 47 lines · DaeSeok Youn
Quoted 1 line

Hi,

Hello.

Quoted 2 lines

Thanks for review.
If I send this patch again, i will use a subject as you comment.

Thanks.

Quoted 1 line

And alignment issue, my patch line seems to be same with your example.

You took out a space from the line with the function pointer but not from the subsequent lines of the arguments.

Quoted 12 lines
Quoted 12 lines

drivers/staging/android/ion/ion.c

Quoted 1 line
drivers/staging/android/ion/ion.c +0 -0

[]

drivers/staging/android/ion/ion.c struct ion_device { · line 59

Quoted 7 lines
drivers/staging/android/ion/ion.c +1 -1
@@ -55,7 +55,7 @@ struct ion_device {
      struct mutex buffer_lock;
      struct rw_semaphore lock;
      struct plist_head heaps;
-     long (*custom_ioctl) (struct ion_client *client, unsigned int cmd,
+     long (*custom_ioctl)(struct ion_client *client, unsigned int cmd,
                            unsigned long arg);

Please realign the arguments to the open parenthesis like:

Quoted 2 lines
Quoted 2 lines

long (*custom_ioctl)(struct ion_client *client, unsigned int cmd,
unsigned long arg);

Your patch has:

long (*custom_ioctl)(struct ion_client *client, unsigned int cmd,
unsigned long arg);

it should be:

long (*custom_ioctl)(struct ion_client *client, unsigned int cmd,
unsigned long arg);

with the "unsigned long arg" aligned immediately after the open parenthesis of the function arguments.

(under the "s" of struct, not the first "t" of struct)