Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1677748

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

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 6/6] Staging: wlan-ng: hfa384x.h:Fix use of volatile is usually wrong
Date 2017-06-29 15:30 +0200
Message-ID <tXHGa-87n-9@gated-at.bofh.it> (permalink)
References <tXHmP-81e-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 2017-06-29 at 18:31 +0530, Jaya Durga wrote:
> 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.

> diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h
[]
> @@ -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, */

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 6/6] Staging: wlan-ng: hfa384x.h:Fix use of volatile is  usually wrong Jaya Durga <rjdurga@gmail.com> - 2017-06-29 15:10 +0200
  Re: [PATCH v2 6/6] Staging: wlan-ng: hfa384x.h:Fix use of volatile  is  usually wrong Joe Perches <joe@perches.com> - 2017-06-29 15:30 +0200

csiph-web