Skip to contentSkip to conversation

Staging:rtl8712: Style - Removed inline block comment to fix "Statements should start on a tapstop"

PATCH NAK Frank Werner-Krippendorf 4 participants 6 messages Aug 5, 2018 – Aug 8, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging:rtl8712: Style - Removed inline block comment to fix "Statements should start on a tapstop"

Removed 5 inline comments "/*volatile*/" rtl87x_event.h, to fix a coding style issue "Statements should start on a tabstop" detected by checkpatch.pl script.

---
 drivers/staging/rtl8712/rtl871x_event.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8712/rtl871x_event.h +5 -5
index 5171379..2e59e8e 100644
@@ -90,13 +90,13 @@ struct event_node {
 	unsigned char *node;
 	unsigned char evt_code;
 	unsigned short evt_sz;
-	/*volatile*/ int *caller_ff_tail;
+	int *caller_ff_tail;
 	int	caller_ff_sz;
 };
 
 struct c2hevent_queue {
-	/*volatile*/ int	head;
-	/*volatile*/ int	tail;
+	int	head;
+	int	tail;
 	struct	event_node	nodes[C2HEVENT_SZ];
 	unsigned char	seq;
 };
@@ -104,8 +104,8 @@ struct c2hevent_queue {
 #define NETWORK_QUEUE_SZ	4
 
 struct network_queue {
-	/*volatile*/ int	head;
-	/*volatile*/ int	tail;
+	int	head;
+	int	tail;
 	struct wlan_bssid_ex networks[NETWORK_QUEUE_SZ];
 };
 
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 15 lines · Frank Werner-Krippendorf

Removed 5 inline comments "/*volatile*/" rtl87x_event.h, to fix a coding style issue "Statements should start on a tabstop" detected by checkpatch.pl script.

---
 drivers/staging/rtl8712/rtl871x_event.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8712/rtl871x_event.h +0 -0
index 5171379..2e59e8e 100644
@@ -90,13 +90,13 @@ struct event_node {
 	unsigned char *node;

drivers/staging/rtl8712/rtl871x_event.h struct event_node { · line 99

Quoted 10 lines
drivers/staging/rtl8712/rtl871x_event.h +1 -3
 	unsigned char evt_code;
 	unsigned short evt_sz;
-	/*volatile*/ int *caller_ff_tail;
+	int *caller_ff_tail;
 	int	caller_ff_sz;
 };
 
 struct c2hevent_queue {
-	/*volatile*/ int	head;
-	/*volatile*/ int	tail;

Those "volatile" seem to imply that something is needed for these variables. Please check to ensure that these are ok to remove in that there is the proper locking for these types of things.

thanks,

greg k-h

#2 lore raw
Quoted 23 lines · Greg KH
Quoted 22 lines · Frank Werner-Krippendorf

Removed 5 inline comments "/*volatile*/" rtl87x_event.h, to fix a coding style issue "Statements should start on a tabstop" detected by checkpatch.pl script.

---
  drivers/staging/rtl8712/rtl871x_event.h | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8712/rtl871x_event.h +1 -1
index 5171379..2e59e8e 100644
@@ -90,13 +90,13 @@ struct event_node {
  	unsigned char *node;
  	unsigned char evt_code;
  	unsigned short evt_sz;
-	/*volatile*/ int *caller_ff_tail;
+	int *caller_ff_tail;
  	int	caller_ff_sz;
  };
 
Quoted 7 lines

drivers/staging/rtl8712/rtl871x_event.h struct event_node { · line 99

Quoted 3 lines
drivers/staging/rtl8712/rtl871x_event.h +0 -2
  struct c2hevent_queue {
-	/*volatile*/ int	head;
-	/*volatile*/ int	tail;

Those "volatile" seem to imply that something is needed for these variables. Please check to ensure that these are ok to remove in that there is the proper locking for these types of things.

Those in-line comments are there as a warning that these variables are special. Just because a tool such as checkpatch says to remove them does not mean that you should; however, if you want to get rid of the warnings, change the space(s) after the "*/" into a tab. That silences the checkpatch warning without removing the implicit warning that these variables are special.

NACK.

Keep in mind that when this driver was submitted, it ran checkpatch cleanly. The fact that there are now warnings is due to changes in the tool. Following those will be a never-ending task.

Larry

#3 lore raw
Quoted 31 lines · Larry Finger
Quoted 21 lines · Greg KH
Quoted 20 lines · Frank Werner-Krippendorf

Removed 5 inline comments "/*volatile*/" rtl87x_event.h, to fix a coding style issue "Statements should start on a tabstop" detected by checkpatch.pl script.

---
  drivers/staging/rtl8712/rtl871x_event.h | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8712/rtl871x_event.h +1 -1
index 5171379..2e59e8e 100644
@@ -90,13 +90,13 @@ struct event_node {
  	unsigned char *node;
  	unsigned char evt_code;
  	unsigned short evt_sz;
-	/*volatile*/ int *caller_ff_tail;
+	int *caller_ff_tail;
  	int	caller_ff_sz;
Quoted 8 lines

drivers/staging/rtl8712/rtl871x_event.h struct event_node { · line 99

Quoted 4 lines
drivers/staging/rtl8712/rtl871x_event.h +0 -2
  };
  struct c2hevent_queue {
-	/*volatile*/ int	head;
-	/*volatile*/ int	tail;

Those "volatile" seem to imply that something is needed for these variables. Please check to ensure that these are ok to remove in that there is the proper locking for these types of things.

Quoted 2 lines

Those in-line comments are there as a warning that these variables are special.

I assumed the comments meant that the locking was buggy...

I'm 100% serious. Normally that's what volatile means in a driver context. Then I interpreted Greg's comments as meaning that warnings are useful because they show us where the locking bugs are so we shouldn't fix the warning until after we review the locking.

regards,
dan carpenter

#4 lore raw

Oh, yeah. Greg's comments were very clear.

regards,
dan carpenter

#5 lore raw
In reply to Greg KH
Quoted 23 lines · Greg KH
Quoted 22 lines · Frank Werner-Krippendorf

Removed 5 inline comments "/*volatile*/" rtl87x_event.h, to fix a coding style issue "Statements should start on a tabstop" detected by checkpatch.pl script.

---
 drivers/staging/rtl8712/rtl871x_event.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8712/rtl871x_event.h +1 -1
index 5171379..2e59e8e 100644
@@ -90,13 +90,13 @@ struct event_node {
 	unsigned char *node;
 	unsigned char evt_code;
 	unsigned short evt_sz;
-	/*volatile*/ int *caller_ff_tail;
+	int *caller_ff_tail;
 	int	caller_ff_sz;
 };
 
Quoted 8 lines

drivers/staging/rtl8712/rtl871x_event.h struct event_node { · line 99

Quoted 3 lines
drivers/staging/rtl8712/rtl871x_event.h +0 -2
 struct c2hevent_queue {
-	/*volatile*/ int	head;
-	/*volatile*/ int	tail;

Those "volatile" seem to imply that something is needed for these variables. Please check to ensure that these are ok to remove in that there is the proper locking for these types of things.

Good news, people! I have done the audit and there is no locking bug. These structs can be deleted because they aren't ever used.

Frank, please can you resend? There may be more unused stuff in here which I didn't see.

regards,
dan carpenter