Skip to contentSkip to conversation

Staging: wlan-ng: hfa384x.h:Fix use of volatile is usually wrong

PATCH In review Jaya Durga 2 participants 2 messages Jun 29, 2017 Staging

lore
Share & tools
lore

Jaya Durga

author
#0 lore raw

PATCH v2 6/6 Staging: wlan-ng: hfa384x.h:Fix use of volatile is usually wrong

Fix checkpatch.pl issue
WARNING: Use of volatile is usually wrong:
see Documentation/process/volatile-considered-harmful.rst

The variables in the private data that are marked volatile don't need to be. Remove the volatile.

---
 drivers/staging/wlan-ng/hfa384x.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wlan-ng/hfa384x.h +1 -1
index 310e2c4..015945f 100644
@@ -1175,7 +1175,7 @@ struct hfa384x_usbctlx {
 	enum ctlx_state state;	/* Tracks running state */
 
 	struct completion done;
-	volatile int reapable;	/* Food for the reaper task */
+	int reapable;	/* Food for the reaper task */
 
 	ctlx_cmdcb_t cmdcb;	/* Async command callback */
 	ctlx_usercb_t usercb;	/* Async user callback, */
Signature · 1 line
1.9.1
#1 lore raw
Quoted 6 lines · Jaya Durga

Fix checkpatch.pl issue
WARNING: Use of volatile is usually wrong:
see Documentation/process/volatile-considered-harmful.rst

The variables in the private data that are marked volatile don't need to be. Remove the volatile.

If you examine the code that uses reapable,
it appears reapable should not be an int
but instead should be an enum cmd_mode.

drivers/staging/wlan-ng/hfa384x.h

Quoted 1 line
drivers/staging/wlan-ng/hfa384x.h +0 -0

[]

Quoted 9 lines
drivers/staging/wlan-ng/hfa384x.h +1 -1
@@ -1175,7 +1175,7 @@ struct hfa384x_usbctlx {
 	enum ctlx_state state;	/* Tracks running state */
 
 	struct completion done;
-	volatile int reapable;	/* Food for the reaper task */
+	int reapable;	/* Food for the reaper task */
 
 	ctlx_cmdcb_t cmdcb;	/* Async command callback */
 	ctlx_usercb_t usercb;	/* Async user callback, */