Re: [PATCH 7/8] staging:rtl8821ae: fix ERROR: spaces required around that '&&' in pci.c

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

 



On Fri, Feb 07, 2014 at 12:45:28AM +0530, Gokulnath A wrote:
> Fixed the error found by checkpatch.pl related to spacing requirement
> in the && condition. 
> 
> Signed-off-by: Gokulnath A <Gokulnath.Avanashilingam@xxxxxxxxxxxx>
> ---
>  drivers/staging/rtl8821ae/pci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8821ae/pci.c b/drivers/staging/rtl8821ae/pci.c
> index c0bdb83..0e3e53d 100644
> --- a/drivers/staging/rtl8821ae/pci.c
> +++ b/drivers/staging/rtl8821ae/pci.c
> @@ -952,7 +952,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
>  			rtl_swlps_beacon(hw, (void*)skb->data, skb->len);
>  			rtl_recognize_peer(hw, (void*)skb->data, skb->len);
>  			if ((rtlpriv->mac80211.opmode == NL80211_IFTYPE_AP) &&
> -			    (rtlpriv->rtlhal.current_bandtype == BAND_ON_2_4G)&&

Haha...  It looks like they deliberately left the space out to make it
under the 80 character limit.  /me curls up into a ball and sobs.

> +			    (rtlpriv->rtlhal.current_bandtype ==
> +							 BAND_ON_2_4G) &&
>  			    (ieee80211_is_beacon(fc) ||
>  			     ieee80211_is_probe_resp(fc))) {

Normally we would say that it should be aligned like this:

			if (rtlpriv->mac80211.opmode == NL80211_IFTYPE_AP &&
			    rtlpriv->rtlhal.current_bandtype ==
			    BAND_ON_2_4G) &&
			    (ieee80211_is_beacon(fc) ||
			     ieee80211_is_probe_resp(fc)) {

That looks pretty bad actually.  It would be better to just go over the
80 character limit.  On the other hand, if we just get rid of the extra
parens then it fits:

			if (rtlpriv->mac80211.opmode == NL80211_IFTYPE_AP &&
			    rtlpriv->rtlhal.current_bandtype == BAND_ON_2_4G) &&
			    (ieee80211_is_beacon(fc) ||
			     ieee80211_is_probe_resp(fc)) {

Two birds with one stone!  Woo hoo!

regards,
dan carpenter

_______________________________________________
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