Re: [PATCH v2] staging: wlan-ng: Remove unnecessary parentheses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 16, 2017 at 09:48:21PM -0400, Frank A. Cancio Bello wrote:
> Remove unnecessary parentheses to comply with preferred coding style for
> the linux kernel and avoid the following checkpatch's message:
> 'CHECK: Unnecessary parentheses around'
> 
> Credits to checkpatch.
> 
> Signed-off-by: Frank A. Cancio Bello <frank@xxxxxxxxxxxxxxxxxxxxxx>
> ---
> Changes in v2:
> 	* I rewrote the log message to improve the style taking in consideration Julia's suggestions.
> 	* I merged in this patch similars changes that initially were in theirs own patch. I will reply that other patch email thread, saying to discard it, to avoid confussion.
> 
>  drivers/staging/wlan-ng/cfg80211.c     | 10 +++++-----
>  drivers/staging/wlan-ng/hfa384x_usb.c  | 18 +++++++++---------
>  drivers/staging/wlan-ng/p80211conv.c   |  6 +++---
>  drivers/staging/wlan-ng/p80211netdev.c |  4 ++--
>  drivers/staging/wlan-ng/p80211req.c    |  2 +-
>  drivers/staging/wlan-ng/prism2fw.c     | 23 +++++++++++------------
>  drivers/staging/wlan-ng/prism2mgmt.c   | 29 ++++++++++++++---------------
>  drivers/staging/wlan-ng/prism2sta.c    |  4 ++--
>  8 files changed, 47 insertions(+), 49 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c
> index 178f6f5..03279aa 100644
> --- a/drivers/staging/wlan-ng/cfg80211.c
> +++ b/drivers/staging/wlan-ng/cfg80211.c
> @@ -265,7 +265,7 @@ static int prism2_get_station(struct wiphy *wiphy, struct net_device *dev,
>  
>  	memset(sinfo, 0, sizeof(*sinfo));
>  
> -	if (!wlandev || (wlandev->msdstate != WLAN_MSD_RUNNING))
> +	if (!wlandev || wlandev->msdstate != WLAN_MSD_RUNNING)

That's not "unnecessary" as now I need to go look up or try to remember
the order of operations for != and || :(

Please don't make things such that it is harder to read for a
programmer.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux