All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: wlan-ng: Remove unnecessary parentheses
@ 2017-10-16 18:26 Frank A. Cancio Bello
  2017-10-16 20:18 ` [Outreachy kernel] " Julia Lawall
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Frank A. Cancio Bello @ 2017-10-16 18:26 UTC (permalink / raw)
  To: pablo, Julia.Lawall; +Cc: gregkh, outreachy-kernel, devel

checkpatch message: 'CHECK: Unnecessary parentheses around'.

Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>
---
FYI:
	* I read 'Ignore checkpatch.pl if it complains about parens around boolean expressions or ternary conditionals in return values, like this: return ((depth > 1) ? (depth - 1) : depth);'. All the fixes in this patch are not in 'return values', so I hope there are OK ;)

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 ++--
 4 files changed, 19 insertions(+), 19 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)
 		return -EOPNOTSUPP;
 
 	/* build request message */
@@ -367,8 +367,8 @@ static int prism2_scan(struct wiphy *wiphy,
 		msg2.bssindex.data = i;
 
 		result = p80211req_dorequest(wlandev, (u8 *)&msg2);
-		if ((result != 0) ||
-		    (msg2.resultcode.data != P80211ENUM_resultcode_success)) {
+		if (result != 0 ||
+		    msg2.resultcode.data != P80211ENUM_resultcode_success) {
 			break;
 		}
 
@@ -475,8 +475,8 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev,
 	}
 
 	/* Set the authorization */
-	if ((sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) ||
-	    ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && !is_wep))
+	if (sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM ||
+	    sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC && !is_wep)
 		msg_join.authtype.data = P80211ENUM_authalg_opensystem;
 	else if ((sme->auth_type == NL80211_AUTHTYPE_SHARED_KEY) ||
 		 ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && is_wep))
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index d1e8218..b5fdfd8 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -1781,9 +1781,9 @@ int hfa384x_drvr_enable(struct hfa384x *hw, u16 macport)
 {
 	int result = 0;
 
-	if ((!hw->isap && macport != 0) ||
-	    (hw->isap && !(macport <= HFA384x_PORTID_MAX)) ||
-	    (hw->port_enabled[macport])) {
+	if (!hw->isap && macport != 0 ||
+	    hw->isap && !(macport <= HFA384x_PORTID_MAX) ||
+	    hw->port_enabled[macport]) {
 		result = -EINVAL;
 	} else {
 		result = hfa384x_cmd_enable(hw, macport);
@@ -2465,7 +2465,7 @@ int hfa384x_drvr_start(struct hfa384x *hw)
 		netdev_err(hw->wlandev->netdev, "Cannot get bulk in endpoint status.\n");
 		goto done;
 	}
-	if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_in))
+	if (status == 1 && usb_clear_halt(hw->usb, hw->endp_in))
 		netdev_err(hw->wlandev->netdev, "Failed to reset bulk in endpoint.\n");
 
 	result =
@@ -2474,7 +2474,7 @@ int hfa384x_drvr_start(struct hfa384x *hw)
 		netdev_err(hw->wlandev->netdev, "Cannot get bulk out endpoint status.\n");
 		goto done;
 	}
-	if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_out))
+	if (status == 1 && usb_clear_halt(hw->usb, hw->endp_out))
 		netdev_err(hw->wlandev->netdev, "Failed to reset bulk out endpoint.\n");
 
 	/* Synchronous unlink, in case we're trying to restart the driver */
@@ -3054,7 +3054,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
 		goto exit;
 
 	skb = hw->rx_urb_skb;
-	if (!skb || (skb->data != urb->transfer_buffer)) {
+	if (!skb || skb->data != urb->transfer_buffer) {
 		WARN_ON(1);
 		return;
 	}
@@ -3501,8 +3501,8 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
 		return;
 
 	/* only prepend the prism header if in the right mode */
-	if ((wlandev->netdev->type == ARPHRD_IEEE80211_PRISM) &&
-	    (hw->sniffhdr != 0)) {
+	if (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM &&
+	    hw->sniffhdr != 0) {
 		struct p80211_caphdr *caphdr;
 		/* The NEW header format! */
 		datap = skb_put(skb, sizeof(struct p80211_caphdr));
@@ -3772,7 +3772,7 @@ static void hfa384x_ctlxout_callback(struct urb *urb)
 
 	spin_unlock_irqrestore(&hw->ctlxq.lock, flags);
 
-	if (!timer_ok && (hw->resp_timer_done == 0)) {
+	if (!timer_ok && hw->resp_timer_done == 0) {
 		spin_lock_irqsave(&hw->ctlxq.lock, flags);
 		goto delresp;
 	}
diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
index c1b6d42..bc63eb2 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -356,10 +356,10 @@ int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv,
 		sizeof(struct wlan_llc));
 
 	/* Test for the various encodings */
-	if ((payload_length >= sizeof(struct wlan_ethhdr)) &&
+	if (payload_length >= sizeof(struct wlan_ethhdr) &&
 	    (e_llc->dsap != 0xaa || e_llc->ssap != 0xaa) &&
-	    ((!ether_addr_equal_unaligned(daddr, e_hdr->daddr)) ||
-	     (!ether_addr_equal_unaligned(saddr, e_hdr->saddr)))) {
+	    (!ether_addr_equal_unaligned(daddr, e_hdr->daddr) ||
+	     !ether_addr_equal_unaligned(saddr, e_hdr->saddr))) {
 		pr_debug("802.3 ENCAP len: %d\n", payload_length);
 		/* 802.3 Encapsulated */
 		/* Test for an overlength frame */
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c
index 0f50365..ad11a3f 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -427,7 +427,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
 
 failed:
 	/* Free up the WEP buffer if it's not the same as the skb */
-	if ((p80211_wep.data) && (p80211_wep.data != skb->data))
+	if (p80211_wep.data && p80211_wep.data != skb->data)
 		kzfree(p80211_wep.data);
 
 	/* we always free the skb here, never in a lower level. */
@@ -491,7 +491,7 @@ static int p80211netdev_ethtool(struct wlandevice *wlandev,
 		edata.cmd = ethcmd;
 
 		if (wlandev->linkstatus &&
-		    (wlandev->macmode != WLAN_MACMODE_NONE)) {
+		    wlandev->macmode != WLAN_MACMODE_NONE) {
 			edata.data = 1;
 		} else {
 			edata.data = 0;
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: wlan-ng: Remove unnecessary parentheses
  2017-10-16 18:26 [PATCH] staging: wlan-ng: Remove unnecessary parentheses Frank A. Cancio Bello
@ 2017-10-16 20:18 ` Julia Lawall
  2017-10-16 21:45   ` Frank A. Cancio Bello
  2017-10-17  1:48 ` [PATCH v2] " Frank A. Cancio Bello
  2017-10-18 10:45 ` [PATCH] " kbuild test robot
  2 siblings, 1 reply; 14+ messages in thread
From: Julia Lawall @ 2017-10-16 20:18 UTC (permalink / raw)
  To: Frank A. Cancio Bello
  Cc: pablo, Julia.Lawall, gregkh, outreachy-kernel, devel

This patch has the same subject line as the one I previously commented on
(modulo the typo in that one).

On Mon, 16 Oct 2017, Frank A. Cancio Bello wrote:

> checkpatch message: 'CHECK: Unnecessary parentheses around'.

Again, say what and why you have done.

julia

> Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>
> ---
> FYI:
> 	* I read 'Ignore checkpatch.pl if it complains about parens around boolean expressions or ternary conditionals in return values, like this: return ((depth > 1) ? (depth - 1) : depth);'. All the fixes in this patch are not in 'return values', so I hope there are OK ;)
>
> 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 ++--
>  4 files changed, 19 insertions(+), 19 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)
>  		return -EOPNOTSUPP;
>
>  	/* build request message */
> @@ -367,8 +367,8 @@ static int prism2_scan(struct wiphy *wiphy,
>  		msg2.bssindex.data = i;
>
>  		result = p80211req_dorequest(wlandev, (u8 *)&msg2);
> -		if ((result != 0) ||
> -		    (msg2.resultcode.data != P80211ENUM_resultcode_success)) {
> +		if (result != 0 ||
> +		    msg2.resultcode.data != P80211ENUM_resultcode_success) {
>  			break;
>  		}
>
> @@ -475,8 +475,8 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev,
>  	}
>
>  	/* Set the authorization */
> -	if ((sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) ||
> -	    ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && !is_wep))
> +	if (sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM ||
> +	    sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC && !is_wep)
>  		msg_join.authtype.data = P80211ENUM_authalg_opensystem;
>  	else if ((sme->auth_type == NL80211_AUTHTYPE_SHARED_KEY) ||
>  		 ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && is_wep))
> diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
> index d1e8218..b5fdfd8 100644
> --- a/drivers/staging/wlan-ng/hfa384x_usb.c
> +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
> @@ -1781,9 +1781,9 @@ int hfa384x_drvr_enable(struct hfa384x *hw, u16 macport)
>  {
>  	int result = 0;
>
> -	if ((!hw->isap && macport != 0) ||
> -	    (hw->isap && !(macport <= HFA384x_PORTID_MAX)) ||
> -	    (hw->port_enabled[macport])) {
> +	if (!hw->isap && macport != 0 ||
> +	    hw->isap && !(macport <= HFA384x_PORTID_MAX) ||
> +	    hw->port_enabled[macport]) {
>  		result = -EINVAL;
>  	} else {
>  		result = hfa384x_cmd_enable(hw, macport);
> @@ -2465,7 +2465,7 @@ int hfa384x_drvr_start(struct hfa384x *hw)
>  		netdev_err(hw->wlandev->netdev, "Cannot get bulk in endpoint status.\n");
>  		goto done;
>  	}
> -	if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_in))
> +	if (status == 1 && usb_clear_halt(hw->usb, hw->endp_in))
>  		netdev_err(hw->wlandev->netdev, "Failed to reset bulk in endpoint.\n");
>
>  	result =
> @@ -2474,7 +2474,7 @@ int hfa384x_drvr_start(struct hfa384x *hw)
>  		netdev_err(hw->wlandev->netdev, "Cannot get bulk out endpoint status.\n");
>  		goto done;
>  	}
> -	if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_out))
> +	if (status == 1 && usb_clear_halt(hw->usb, hw->endp_out))
>  		netdev_err(hw->wlandev->netdev, "Failed to reset bulk out endpoint.\n");
>
>  	/* Synchronous unlink, in case we're trying to restart the driver */
> @@ -3054,7 +3054,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
>  		goto exit;
>
>  	skb = hw->rx_urb_skb;
> -	if (!skb || (skb->data != urb->transfer_buffer)) {
> +	if (!skb || skb->data != urb->transfer_buffer) {
>  		WARN_ON(1);
>  		return;
>  	}
> @@ -3501,8 +3501,8 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
>  		return;
>
>  	/* only prepend the prism header if in the right mode */
> -	if ((wlandev->netdev->type == ARPHRD_IEEE80211_PRISM) &&
> -	    (hw->sniffhdr != 0)) {
> +	if (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM &&
> +	    hw->sniffhdr != 0) {
>  		struct p80211_caphdr *caphdr;
>  		/* The NEW header format! */
>  		datap = skb_put(skb, sizeof(struct p80211_caphdr));
> @@ -3772,7 +3772,7 @@ static void hfa384x_ctlxout_callback(struct urb *urb)
>
>  	spin_unlock_irqrestore(&hw->ctlxq.lock, flags);
>
> -	if (!timer_ok && (hw->resp_timer_done == 0)) {
> +	if (!timer_ok && hw->resp_timer_done == 0) {
>  		spin_lock_irqsave(&hw->ctlxq.lock, flags);
>  		goto delresp;
>  	}
> diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
> index c1b6d42..bc63eb2 100644
> --- a/drivers/staging/wlan-ng/p80211conv.c
> +++ b/drivers/staging/wlan-ng/p80211conv.c
> @@ -356,10 +356,10 @@ int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv,
>  		sizeof(struct wlan_llc));
>
>  	/* Test for the various encodings */
> -	if ((payload_length >= sizeof(struct wlan_ethhdr)) &&
> +	if (payload_length >= sizeof(struct wlan_ethhdr) &&
>  	    (e_llc->dsap != 0xaa || e_llc->ssap != 0xaa) &&
> -	    ((!ether_addr_equal_unaligned(daddr, e_hdr->daddr)) ||
> -	     (!ether_addr_equal_unaligned(saddr, e_hdr->saddr)))) {
> +	    (!ether_addr_equal_unaligned(daddr, e_hdr->daddr) ||
> +	     !ether_addr_equal_unaligned(saddr, e_hdr->saddr))) {
>  		pr_debug("802.3 ENCAP len: %d\n", payload_length);
>  		/* 802.3 Encapsulated */
>  		/* Test for an overlength frame */
> diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c
> index 0f50365..ad11a3f 100644
> --- a/drivers/staging/wlan-ng/p80211netdev.c
> +++ b/drivers/staging/wlan-ng/p80211netdev.c
> @@ -427,7 +427,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
>
>  failed:
>  	/* Free up the WEP buffer if it's not the same as the skb */
> -	if ((p80211_wep.data) && (p80211_wep.data != skb->data))
> +	if (p80211_wep.data && p80211_wep.data != skb->data)
>  		kzfree(p80211_wep.data);
>
>  	/* we always free the skb here, never in a lower level. */
> @@ -491,7 +491,7 @@ static int p80211netdev_ethtool(struct wlandevice *wlandev,
>  		edata.cmd = ethcmd;
>
>  		if (wlandev->linkstatus &&
> -		    (wlandev->macmode != WLAN_MACMODE_NONE)) {
> +		    wlandev->macmode != WLAN_MACMODE_NONE) {
>  			edata.data = 1;
>  		} else {
>  			edata.data = 0;
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20171016182614.GA3341%40ubuntu-server-1604.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: wlan-ng: Remove unnecessary parentheses
  2017-10-16 20:18 ` [Outreachy kernel] " Julia Lawall
@ 2017-10-16 21:45   ` Frank A. Cancio Bello
  2017-10-16 21:47     ` Julia Lawall
  0 siblings, 1 reply; 14+ messages in thread
From: Frank A. Cancio Bello @ 2017-10-16 21:45 UTC (permalink / raw)
  To: Julia Lawall; +Cc: pablo, gregkh, outreachy-kernel, devel

On Mon, Oct 16, 2017 at 10:18:14PM +0200, Julia Lawall wrote:
> This patch has the same subject line as the one I previously commented on
> (modulo the typo in that one).
> 

Thanks Julia for your quick response. Before work on your suggestions I have a question regarding the above comment:

Do you want that I merge this two patches to avoid two patches with the same subject line? Or they are OK as two with the same subject line? I split the changes into two patches to avoid big patches and the subject line come as the same because I'm doing the same in each of them ;)

> On Mon, 16 Oct 2017, Frank A. Cancio Bello wrote:
> 
> > checkpatch message: 'CHECK: Unnecessary parentheses around'.
> 
> Again, say what and why you have done.
> 
> julia
> 
> > Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>
> > ---
> > FYI:
> > 	* I read 'Ignore checkpatch.pl if it complains about parens around boolean expressions or ternary conditionals in return values, like this: return ((depth > 1) ? (depth - 1) : depth);'. All the fixes in this patch are not in 'return values', so I hope there are OK ;)
> >
> > 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 ++--
> >  4 files changed, 19 insertions(+), 19 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)
> >  		return -EOPNOTSUPP;
> >
> >  	/* build request message */
> > @@ -367,8 +367,8 @@ static int prism2_scan(struct wiphy *wiphy,
> >  		msg2.bssindex.data = i;
> >
> >  		result = p80211req_dorequest(wlandev, (u8 *)&msg2);
> > -		if ((result != 0) ||
> > -		    (msg2.resultcode.data != P80211ENUM_resultcode_success)) {
> > +		if (result != 0 ||
> > +		    msg2.resultcode.data != P80211ENUM_resultcode_success) {
> >  			break;
> >  		}
> >
> > @@ -475,8 +475,8 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev,
> >  	}
> >
> >  	/* Set the authorization */
> > -	if ((sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) ||
> > -	    ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && !is_wep))
> > +	if (sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM ||
> > +	    sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC && !is_wep)
> >  		msg_join.authtype.data = P80211ENUM_authalg_opensystem;
> >  	else if ((sme->auth_type == NL80211_AUTHTYPE_SHARED_KEY) ||
> >  		 ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && is_wep))
> > diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
> > index d1e8218..b5fdfd8 100644
> > --- a/drivers/staging/wlan-ng/hfa384x_usb.c
> > +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
> > @@ -1781,9 +1781,9 @@ int hfa384x_drvr_enable(struct hfa384x *hw, u16 macport)
> >  {
> >  	int result = 0;
> >
> > -	if ((!hw->isap && macport != 0) ||
> > -	    (hw->isap && !(macport <= HFA384x_PORTID_MAX)) ||
> > -	    (hw->port_enabled[macport])) {
> > +	if (!hw->isap && macport != 0 ||
> > +	    hw->isap && !(macport <= HFA384x_PORTID_MAX) ||
> > +	    hw->port_enabled[macport]) {
> >  		result = -EINVAL;
> >  	} else {
> >  		result = hfa384x_cmd_enable(hw, macport);
> > @@ -2465,7 +2465,7 @@ int hfa384x_drvr_start(struct hfa384x *hw)
> >  		netdev_err(hw->wlandev->netdev, "Cannot get bulk in endpoint status.\n");
> >  		goto done;
> >  	}
> > -	if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_in))
> > +	if (status == 1 && usb_clear_halt(hw->usb, hw->endp_in))
> >  		netdev_err(hw->wlandev->netdev, "Failed to reset bulk in endpoint.\n");
> >
> >  	result =
> > @@ -2474,7 +2474,7 @@ int hfa384x_drvr_start(struct hfa384x *hw)
> >  		netdev_err(hw->wlandev->netdev, "Cannot get bulk out endpoint status.\n");
> >  		goto done;
> >  	}
> > -	if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_out))
> > +	if (status == 1 && usb_clear_halt(hw->usb, hw->endp_out))
> >  		netdev_err(hw->wlandev->netdev, "Failed to reset bulk out endpoint.\n");
> >
> >  	/* Synchronous unlink, in case we're trying to restart the driver */
> > @@ -3054,7 +3054,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
> >  		goto exit;
> >
> >  	skb = hw->rx_urb_skb;
> > -	if (!skb || (skb->data != urb->transfer_buffer)) {
> > +	if (!skb || skb->data != urb->transfer_buffer) {
> >  		WARN_ON(1);
> >  		return;
> >  	}
> > @@ -3501,8 +3501,8 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
> >  		return;
> >
> >  	/* only prepend the prism header if in the right mode */
> > -	if ((wlandev->netdev->type == ARPHRD_IEEE80211_PRISM) &&
> > -	    (hw->sniffhdr != 0)) {
> > +	if (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM &&
> > +	    hw->sniffhdr != 0) {
> >  		struct p80211_caphdr *caphdr;
> >  		/* The NEW header format! */
> >  		datap = skb_put(skb, sizeof(struct p80211_caphdr));
> > @@ -3772,7 +3772,7 @@ static void hfa384x_ctlxout_callback(struct urb *urb)
> >
> >  	spin_unlock_irqrestore(&hw->ctlxq.lock, flags);
> >
> > -	if (!timer_ok && (hw->resp_timer_done == 0)) {
> > +	if (!timer_ok && hw->resp_timer_done == 0) {
> >  		spin_lock_irqsave(&hw->ctlxq.lock, flags);
> >  		goto delresp;
> >  	}
> > diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
> > index c1b6d42..bc63eb2 100644
> > --- a/drivers/staging/wlan-ng/p80211conv.c
> > +++ b/drivers/staging/wlan-ng/p80211conv.c
> > @@ -356,10 +356,10 @@ int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv,
> >  		sizeof(struct wlan_llc));
> >
> >  	/* Test for the various encodings */
> > -	if ((payload_length >= sizeof(struct wlan_ethhdr)) &&
> > +	if (payload_length >= sizeof(struct wlan_ethhdr) &&
> >  	    (e_llc->dsap != 0xaa || e_llc->ssap != 0xaa) &&
> > -	    ((!ether_addr_equal_unaligned(daddr, e_hdr->daddr)) ||
> > -	     (!ether_addr_equal_unaligned(saddr, e_hdr->saddr)))) {
> > +	    (!ether_addr_equal_unaligned(daddr, e_hdr->daddr) ||
> > +	     !ether_addr_equal_unaligned(saddr, e_hdr->saddr))) {
> >  		pr_debug("802.3 ENCAP len: %d\n", payload_length);
> >  		/* 802.3 Encapsulated */
> >  		/* Test for an overlength frame */
> > diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c
> > index 0f50365..ad11a3f 100644
> > --- a/drivers/staging/wlan-ng/p80211netdev.c
> > +++ b/drivers/staging/wlan-ng/p80211netdev.c
> > @@ -427,7 +427,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
> >
> >  failed:
> >  	/* Free up the WEP buffer if it's not the same as the skb */
> > -	if ((p80211_wep.data) && (p80211_wep.data != skb->data))
> > +	if (p80211_wep.data && p80211_wep.data != skb->data)
> >  		kzfree(p80211_wep.data);
> >
> >  	/* we always free the skb here, never in a lower level. */
> > @@ -491,7 +491,7 @@ static int p80211netdev_ethtool(struct wlandevice *wlandev,
> >  		edata.cmd = ethcmd;
> >
> >  		if (wlandev->linkstatus &&
> > -		    (wlandev->macmode != WLAN_MACMODE_NONE)) {
> > +		    wlandev->macmode != WLAN_MACMODE_NONE) {
> >  			edata.data = 1;
> >  		} else {
> >  			edata.data = 0;
> > --
> > 2.7.4
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20171016182614.GA3341%40ubuntu-server-1604.
> > For more options, visit https://groups.google.com/d/optout.
> >


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: wlan-ng: Remove unnecessary parentheses
  2017-10-16 21:45   ` Frank A. Cancio Bello
@ 2017-10-16 21:47     ` Julia Lawall
  0 siblings, 0 replies; 14+ messages in thread
From: Julia Lawall @ 2017-10-16 21:47 UTC (permalink / raw)
  To: Frank A. Cancio Bello; +Cc: pablo, gregkh, outreachy-kernel, devel



On Mon, 16 Oct 2017, Frank A. Cancio Bello wrote:

> On Mon, Oct 16, 2017 at 10:18:14PM +0200, Julia Lawall wrote:
> > This patch has the same subject line as the one I previously commented on
> > (modulo the typo in that one).
> >
>
> Thanks Julia for your quick response. Before work on your suggestions I have a question regarding the above comment:
>
> Do you want that I merge this two patches to avoid two patches with the
> same subject line? Or they are OK as two with the same subject line?

No, this is not OK.  Either merge the patches or find a different subject
line.  If there is some reason why you chose to put one file in one patch
or the other then that may suggest what the subject line should be.

julia

> I
> split the changes into two patches to avoid big patches and the subject
> line come as the same because I'm doing the same in each of them ;)
>
> > On Mon, 16 Oct 2017, Frank A. Cancio Bello wrote:
> >
> > > checkpatch message: 'CHECK: Unnecessary parentheses around'.
> >
> > Again, say what and why you have done.
> >
> > julia
> >
> > > Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>
> > > ---
> > > FYI:
> > > 	* I read 'Ignore checkpatch.pl if it complains about parens around boolean expressions or ternary conditionals in return values, like this: return ((depth > 1) ? (depth - 1) : depth);'. All the fixes in this patch are not in 'return values', so I hope there are OK ;)
> > >
> > > 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 ++--
> > >  4 files changed, 19 insertions(+), 19 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)
> > >  		return -EOPNOTSUPP;
> > >
> > >  	/* build request message */
> > > @@ -367,8 +367,8 @@ static int prism2_scan(struct wiphy *wiphy,
> > >  		msg2.bssindex.data = i;
> > >
> > >  		result = p80211req_dorequest(wlandev, (u8 *)&msg2);
> > > -		if ((result != 0) ||
> > > -		    (msg2.resultcode.data != P80211ENUM_resultcode_success)) {
> > > +		if (result != 0 ||
> > > +		    msg2.resultcode.data != P80211ENUM_resultcode_success) {
> > >  			break;
> > >  		}
> > >
> > > @@ -475,8 +475,8 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev,
> > >  	}
> > >
> > >  	/* Set the authorization */
> > > -	if ((sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) ||
> > > -	    ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && !is_wep))
> > > +	if (sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM ||
> > > +	    sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC && !is_wep)
> > >  		msg_join.authtype.data = P80211ENUM_authalg_opensystem;
> > >  	else if ((sme->auth_type == NL80211_AUTHTYPE_SHARED_KEY) ||
> > >  		 ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && is_wep))
> > > diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
> > > index d1e8218..b5fdfd8 100644
> > > --- a/drivers/staging/wlan-ng/hfa384x_usb.c
> > > +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
> > > @@ -1781,9 +1781,9 @@ int hfa384x_drvr_enable(struct hfa384x *hw, u16 macport)
> > >  {
> > >  	int result = 0;
> > >
> > > -	if ((!hw->isap && macport != 0) ||
> > > -	    (hw->isap && !(macport <= HFA384x_PORTID_MAX)) ||
> > > -	    (hw->port_enabled[macport])) {
> > > +	if (!hw->isap && macport != 0 ||
> > > +	    hw->isap && !(macport <= HFA384x_PORTID_MAX) ||
> > > +	    hw->port_enabled[macport]) {
> > >  		result = -EINVAL;
> > >  	} else {
> > >  		result = hfa384x_cmd_enable(hw, macport);
> > > @@ -2465,7 +2465,7 @@ int hfa384x_drvr_start(struct hfa384x *hw)
> > >  		netdev_err(hw->wlandev->netdev, "Cannot get bulk in endpoint status.\n");
> > >  		goto done;
> > >  	}
> > > -	if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_in))
> > > +	if (status == 1 && usb_clear_halt(hw->usb, hw->endp_in))
> > >  		netdev_err(hw->wlandev->netdev, "Failed to reset bulk in endpoint.\n");
> > >
> > >  	result =
> > > @@ -2474,7 +2474,7 @@ int hfa384x_drvr_start(struct hfa384x *hw)
> > >  		netdev_err(hw->wlandev->netdev, "Cannot get bulk out endpoint status.\n");
> > >  		goto done;
> > >  	}
> > > -	if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_out))
> > > +	if (status == 1 && usb_clear_halt(hw->usb, hw->endp_out))
> > >  		netdev_err(hw->wlandev->netdev, "Failed to reset bulk out endpoint.\n");
> > >
> > >  	/* Synchronous unlink, in case we're trying to restart the driver */
> > > @@ -3054,7 +3054,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
> > >  		goto exit;
> > >
> > >  	skb = hw->rx_urb_skb;
> > > -	if (!skb || (skb->data != urb->transfer_buffer)) {
> > > +	if (!skb || skb->data != urb->transfer_buffer) {
> > >  		WARN_ON(1);
> > >  		return;
> > >  	}
> > > @@ -3501,8 +3501,8 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
> > >  		return;
> > >
> > >  	/* only prepend the prism header if in the right mode */
> > > -	if ((wlandev->netdev->type == ARPHRD_IEEE80211_PRISM) &&
> > > -	    (hw->sniffhdr != 0)) {
> > > +	if (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM &&
> > > +	    hw->sniffhdr != 0) {
> > >  		struct p80211_caphdr *caphdr;
> > >  		/* The NEW header format! */
> > >  		datap = skb_put(skb, sizeof(struct p80211_caphdr));
> > > @@ -3772,7 +3772,7 @@ static void hfa384x_ctlxout_callback(struct urb *urb)
> > >
> > >  	spin_unlock_irqrestore(&hw->ctlxq.lock, flags);
> > >
> > > -	if (!timer_ok && (hw->resp_timer_done == 0)) {
> > > +	if (!timer_ok && hw->resp_timer_done == 0) {
> > >  		spin_lock_irqsave(&hw->ctlxq.lock, flags);
> > >  		goto delresp;
> > >  	}
> > > diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
> > > index c1b6d42..bc63eb2 100644
> > > --- a/drivers/staging/wlan-ng/p80211conv.c
> > > +++ b/drivers/staging/wlan-ng/p80211conv.c
> > > @@ -356,10 +356,10 @@ int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv,
> > >  		sizeof(struct wlan_llc));
> > >
> > >  	/* Test for the various encodings */
> > > -	if ((payload_length >= sizeof(struct wlan_ethhdr)) &&
> > > +	if (payload_length >= sizeof(struct wlan_ethhdr) &&
> > >  	    (e_llc->dsap != 0xaa || e_llc->ssap != 0xaa) &&
> > > -	    ((!ether_addr_equal_unaligned(daddr, e_hdr->daddr)) ||
> > > -	     (!ether_addr_equal_unaligned(saddr, e_hdr->saddr)))) {
> > > +	    (!ether_addr_equal_unaligned(daddr, e_hdr->daddr) ||
> > > +	     !ether_addr_equal_unaligned(saddr, e_hdr->saddr))) {
> > >  		pr_debug("802.3 ENCAP len: %d\n", payload_length);
> > >  		/* 802.3 Encapsulated */
> > >  		/* Test for an overlength frame */
> > > diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c
> > > index 0f50365..ad11a3f 100644
> > > --- a/drivers/staging/wlan-ng/p80211netdev.c
> > > +++ b/drivers/staging/wlan-ng/p80211netdev.c
> > > @@ -427,7 +427,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
> > >
> > >  failed:
> > >  	/* Free up the WEP buffer if it's not the same as the skb */
> > > -	if ((p80211_wep.data) && (p80211_wep.data != skb->data))
> > > +	if (p80211_wep.data && p80211_wep.data != skb->data)
> > >  		kzfree(p80211_wep.data);
> > >
> > >  	/* we always free the skb here, never in a lower level. */
> > > @@ -491,7 +491,7 @@ static int p80211netdev_ethtool(struct wlandevice *wlandev,
> > >  		edata.cmd = ethcmd;
> > >
> > >  		if (wlandev->linkstatus &&
> > > -		    (wlandev->macmode != WLAN_MACMODE_NONE)) {
> > > +		    wlandev->macmode != WLAN_MACMODE_NONE) {
> > >  			edata.data = 1;
> > >  		} else {
> > >  			edata.data = 0;
> > > --
> > > 2.7.4
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20171016182614.GA3341%40ubuntu-server-1604.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20171016214556.GA2215%40ubuntu-server-1604.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2] staging: wlan-ng: Remove unnecessary parentheses
  2017-10-16 18:26 [PATCH] staging: wlan-ng: Remove unnecessary parentheses Frank A. Cancio Bello
  2017-10-16 20:18 ` [Outreachy kernel] " Julia Lawall
@ 2017-10-17  1:48 ` Frank A. Cancio Bello
  2017-10-18 14:17   ` Greg KH
  2017-10-19 11:02   ` [PATCH v2] " kbuild test robot
  2017-10-18 10:45 ` [PATCH] " kbuild test robot
  2 siblings, 2 replies; 14+ messages in thread
From: Frank A. Cancio Bello @ 2017-10-17  1:48 UTC (permalink / raw)
  To: Julia.Lawall, pablo; +Cc: gregkh, outreachy-kernel, devel

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@generalsoftwareinc.com>
---
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)
 		return -EOPNOTSUPP;
 
 	/* build request message */
@@ -367,8 +367,8 @@ static int prism2_scan(struct wiphy *wiphy,
 		msg2.bssindex.data = i;
 
 		result = p80211req_dorequest(wlandev, (u8 *)&msg2);
-		if ((result != 0) ||
-		    (msg2.resultcode.data != P80211ENUM_resultcode_success)) {
+		if (result != 0 ||
+		    msg2.resultcode.data != P80211ENUM_resultcode_success) {
 			break;
 		}
 
@@ -475,8 +475,8 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev,
 	}
 
 	/* Set the authorization */
-	if ((sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) ||
-	    ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && !is_wep))
+	if (sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM ||
+	    sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC && !is_wep)
 		msg_join.authtype.data = P80211ENUM_authalg_opensystem;
 	else if ((sme->auth_type == NL80211_AUTHTYPE_SHARED_KEY) ||
 		 ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && is_wep))
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index d1e8218..b5fdfd8 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -1781,9 +1781,9 @@ int hfa384x_drvr_enable(struct hfa384x *hw, u16 macport)
 {
 	int result = 0;
 
-	if ((!hw->isap && macport != 0) ||
-	    (hw->isap && !(macport <= HFA384x_PORTID_MAX)) ||
-	    (hw->port_enabled[macport])) {
+	if (!hw->isap && macport != 0 ||
+	    hw->isap && !(macport <= HFA384x_PORTID_MAX) ||
+	    hw->port_enabled[macport]) {
 		result = -EINVAL;
 	} else {
 		result = hfa384x_cmd_enable(hw, macport);
@@ -2465,7 +2465,7 @@ int hfa384x_drvr_start(struct hfa384x *hw)
 		netdev_err(hw->wlandev->netdev, "Cannot get bulk in endpoint status.\n");
 		goto done;
 	}
-	if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_in))
+	if (status == 1 && usb_clear_halt(hw->usb, hw->endp_in))
 		netdev_err(hw->wlandev->netdev, "Failed to reset bulk in endpoint.\n");
 
 	result =
@@ -2474,7 +2474,7 @@ int hfa384x_drvr_start(struct hfa384x *hw)
 		netdev_err(hw->wlandev->netdev, "Cannot get bulk out endpoint status.\n");
 		goto done;
 	}
-	if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_out))
+	if (status == 1 && usb_clear_halt(hw->usb, hw->endp_out))
 		netdev_err(hw->wlandev->netdev, "Failed to reset bulk out endpoint.\n");
 
 	/* Synchronous unlink, in case we're trying to restart the driver */
@@ -3054,7 +3054,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
 		goto exit;
 
 	skb = hw->rx_urb_skb;
-	if (!skb || (skb->data != urb->transfer_buffer)) {
+	if (!skb || skb->data != urb->transfer_buffer) {
 		WARN_ON(1);
 		return;
 	}
@@ -3501,8 +3501,8 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
 		return;
 
 	/* only prepend the prism header if in the right mode */
-	if ((wlandev->netdev->type == ARPHRD_IEEE80211_PRISM) &&
-	    (hw->sniffhdr != 0)) {
+	if (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM &&
+	    hw->sniffhdr != 0) {
 		struct p80211_caphdr *caphdr;
 		/* The NEW header format! */
 		datap = skb_put(skb, sizeof(struct p80211_caphdr));
@@ -3772,7 +3772,7 @@ static void hfa384x_ctlxout_callback(struct urb *urb)
 
 	spin_unlock_irqrestore(&hw->ctlxq.lock, flags);
 
-	if (!timer_ok && (hw->resp_timer_done == 0)) {
+	if (!timer_ok && hw->resp_timer_done == 0) {
 		spin_lock_irqsave(&hw->ctlxq.lock, flags);
 		goto delresp;
 	}
diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
index c1b6d42..bc63eb2 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -356,10 +356,10 @@ int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv,
 		sizeof(struct wlan_llc));
 
 	/* Test for the various encodings */
-	if ((payload_length >= sizeof(struct wlan_ethhdr)) &&
+	if (payload_length >= sizeof(struct wlan_ethhdr) &&
 	    (e_llc->dsap != 0xaa || e_llc->ssap != 0xaa) &&
-	    ((!ether_addr_equal_unaligned(daddr, e_hdr->daddr)) ||
-	     (!ether_addr_equal_unaligned(saddr, e_hdr->saddr)))) {
+	    (!ether_addr_equal_unaligned(daddr, e_hdr->daddr) ||
+	     !ether_addr_equal_unaligned(saddr, e_hdr->saddr))) {
 		pr_debug("802.3 ENCAP len: %d\n", payload_length);
 		/* 802.3 Encapsulated */
 		/* Test for an overlength frame */
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c
index 0f50365..ad11a3f 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -427,7 +427,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
 
 failed:
 	/* Free up the WEP buffer if it's not the same as the skb */
-	if ((p80211_wep.data) && (p80211_wep.data != skb->data))
+	if (p80211_wep.data && p80211_wep.data != skb->data)
 		kzfree(p80211_wep.data);
 
 	/* we always free the skb here, never in a lower level. */
@@ -491,7 +491,7 @@ static int p80211netdev_ethtool(struct wlandevice *wlandev,
 		edata.cmd = ethcmd;
 
 		if (wlandev->linkstatus &&
-		    (wlandev->macmode != WLAN_MACMODE_NONE)) {
+		    wlandev->macmode != WLAN_MACMODE_NONE) {
 			edata.data = 1;
 		} else {
 			edata.data = 0;
diff --git a/drivers/staging/wlan-ng/p80211req.c b/drivers/staging/wlan-ng/p80211req.c
index afe8477..0d1556c 100644
--- a/drivers/staging/wlan-ng/p80211req.c
+++ b/drivers/staging/wlan-ng/p80211req.c
@@ -124,7 +124,7 @@ int p80211req_dorequest(struct wlandevice *wlandev, u8 *msgbuf)
 
 	/* Check Permissions */
 	if (!capable(CAP_NET_ADMIN) &&
-	    (msg->msgcode != DIDmsg_dot11req_mibget)) {
+	    msg->msgcode != DIDmsg_dot11req_mibget) {
 		netdev_err(wlandev->netdev,
 			   "%s: only dot11req_mibget allowed for non-root.\n",
 			   wlandev->name);
diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index 344bec8..5b9aa63 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -1177,8 +1177,8 @@ static int validate_identity(void)
 				 s3info[i].info.compat.top);
 
 			/* MAC compat range */
-			if ((s3info[i].info.compat.role == 1) &&
-			    (s3info[i].info.compat.id == 2)) {
+			if (s3info[i].info.compat.role == 1 &&
+			    s3info[i].info.compat.id == 2) {
 				if (s3info[i].info.compat.variant !=
 				    macid.variant) {
 					result = 2;
@@ -1186,17 +1186,16 @@ static int validate_identity(void)
 			}
 
 			/* PRI compat range */
-			if ((s3info[i].info.compat.role == 1) &&
-			    (s3info[i].info.compat.id == 3)) {
-				if ((s3info[i].info.compat.bottom > priid.top)
-				    || (s3info[i].info.compat.top <
-					priid.bottom)) {
+			if (s3info[i].info.compat.role == 1 &&
+			    s3info[i].info.compat.id == 3) {
+				if (s3info[i].info.compat.bottom > priid.top ||
+				    s3info[i].info.compat.top < priid.bottom) {
 					result = 3;
 				}
 			}
 			/* SEC compat range */
-			if ((s3info[i].info.compat.role == 1) &&
-			    (s3info[i].info.compat.id == 4)) {
+			if (s3info[i].info.compat.role == 1 &&
+			    s3info[i].info.compat.id == 4) {
 				/* FIXME: isn't something missing here? */
 			}
 
@@ -1218,8 +1217,8 @@ static int validate_identity(void)
 				continue;
 			if (nicid.minor != s3info[i].info.version.minor)
 				continue;
-			if ((nicid.variant != s3info[i].info.version.variant) &&
-			    (nicid.id != 0x8008))
+			if (nicid.variant != s3info[i].info.version.variant &&
+			    nicid.id != 0x8008)
 				continue;
 
 			trump = 1;
@@ -1234,7 +1233,7 @@ static int validate_identity(void)
 	}
 	/* walk through */
 
-	if (trump && (result != 2))
+	if (trump && result != 2)
 		result = 0;
 	return result;
 }
diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
index 7207059..6ac2b48 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -402,7 +402,7 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp)
 		goto exit;
 	}
 
-	item = &(hw->scanresults->info.hscanresult.result[req->bssindex.data]);
+	item = &hw->scanresults->info.hscanresult.result[req->bssindex.data];
 	/* signal and noise */
 	req->signal.status = P80211ENUM_msgitem_status_data_ok;
 	req->noise.status = P80211ENUM_msgitem_status_data_ok;
@@ -427,7 +427,7 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp)
 
 #define REQBASICRATE(N) \
 	do { \
-		if ((count >= N) && DOT11_RATE5_ISBASIC_GET( \
+		if (count >= N && DOT11_RATE5_ISBASIC_GET( \
 			item->supprates[(N) - 1])) { \
 			req->basicrate ## N .data = item->supprates[(N) - 1]; \
 			req->basicrate ## N .status = \
@@ -562,7 +562,7 @@ int prism2mgmt_start(struct wlandevice *wlandev, void *msgp)
 	/*** STATION ***/
 	/* Set the REQUIRED config items */
 	/* SSID */
-	pstr = (struct p80211pstrd *)&(msg->ssid.data);
+	pstr = (struct p80211pstrd *)&msg->ssid.data;
 	prism2mgmt_pstr2bytestr(p2bytestr, pstr);
 	result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNSSID,
 					bytebuf, HFA384x_RID_CNFOWNSSID_LEN);
@@ -1063,7 +1063,7 @@ int prism2mgmt_autojoin(struct wlandevice *wlandev, void *msgp)
 
 	/* Set the ssid */
 	memset(bytebuf, 0, 256);
-	pstr = (struct p80211pstrd *)&(msg->ssid.data);
+	pstr = (struct p80211pstrd *)&msg->ssid.data;
 	prism2mgmt_pstr2bytestr(p2bytestr, pstr);
 	result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFDESIREDSSID,
 					bytebuf,
@@ -1187,7 +1187,7 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
 				/* Save macport 0 state */
 				result = hfa384x_drvr_getconfig16(hw,
 						  HFA384x_RID_CNFPORTTYPE,
-						  &(hw->presniff_port_type));
+						  &hw->presniff_port_type);
 				if (result) {
 					netdev_dbg
 					(wlandev->netdev,
@@ -1198,7 +1198,7 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
 				/* Save the wepflags state */
 				result = hfa384x_drvr_getconfig16(hw,
 						  HFA384x_RID_CNFWEPFLAGS,
-						  &(hw->presniff_wepflags));
+						  &hw->presniff_wepflags);
 				if (result) {
 					netdev_dbg
 					(wlandev->netdev,
@@ -1256,10 +1256,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
 				     word, result);
 				goto failed;
 			}
-			if ((msg->keepwepflags.status ==
-			     P80211ENUM_msgitem_status_data_ok)
-			    && (msg->keepwepflags.data !=
-				P80211ENUM_truth_true)) {
+			if (msg->keepwepflags.status ==
+			     P80211ENUM_msgitem_status_data_ok &&
+			    msg->keepwepflags.data != P80211ENUM_truth_true) {
 				/* Set the wepflags for no decryption */
 				word = HFA384x_WEPFLAGS_DISABLE_TXCRYPT |
 				    HFA384x_WEPFLAGS_DISABLE_RXCRYPT;
@@ -1279,8 +1278,8 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
 		}
 
 		/* Do we want to strip the FCS in monitor mode? */
-		if ((msg->stripfcs.status == P80211ENUM_msgitem_status_data_ok)
-		    && (msg->stripfcs.data == P80211ENUM_truth_true)) {
+		if (msg->stripfcs.status == P80211ENUM_msgitem_status_data_ok &&
+		    msg->stripfcs.data == P80211ENUM_truth_true) {
 			hw->sniff_fcs = 0;
 		} else {
 			hw->sniff_fcs = 1;
@@ -1317,9 +1316,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
 
 		/* Set the driver state */
 		/* Do we want the prism2 header? */
-		if ((msg->prismheader.status ==
-		     P80211ENUM_msgitem_status_data_ok) &&
-		    (msg->prismheader.data == P80211ENUM_truth_true)) {
+		if (msg->prismheader.status ==
+		     P80211ENUM_msgitem_status_data_ok &&
+		    msg->prismheader.data == P80211ENUM_truth_true) {
 			hw->sniffhdr = 0;
 			wlandev->netdev->type = ARPHRD_IEEE80211_PRISM;
 		} else if ((msg->wlanheader.status ==
diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c
index 070a237..38956fb 100644
--- a/drivers/staging/wlan-ng/prism2sta.c
+++ b/drivers/staging/wlan-ng/prism2sta.c
@@ -1929,8 +1929,8 @@ void prism2sta_commsqual_defer(struct work_struct *data)
 		return;
 
 	/* we don't care if we're in AP mode */
-	if ((wlandev->macmode == WLAN_MACMODE_NONE) ||
-	    (wlandev->macmode == WLAN_MACMODE_ESS_AP)) {
+	if (wlandev->macmode == WLAN_MACMODE_NONE ||
+	    wlandev->macmode == WLAN_MACMODE_ESS_AP) {
 		return;
 	}
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] staging: wlan-ng: Remove unnecessary parentheses
  2017-10-16 18:26 [PATCH] staging: wlan-ng: Remove unnecessary parentheses Frank A. Cancio Bello
  2017-10-16 20:18 ` [Outreachy kernel] " Julia Lawall
  2017-10-17  1:48 ` [PATCH v2] " Frank A. Cancio Bello
@ 2017-10-18 10:45 ` kbuild test robot
  2 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2017-10-18 10:45 UTC (permalink / raw)
  To: Frank A. Cancio Bello
  Cc: kbuild-all, pablo, Julia.Lawall, devel, gregkh, outreachy-kernel

[-- Attachment #1: Type: text/plain, Size: 2782 bytes --]

Hi Frank,

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.14-rc5 next-20171017]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Frank-A-Cancio-Bello/staging-wlan-ng-Remove-unnecessary-parentheses/20171018-180433
config: x86_64-randconfig-x005-201742 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from drivers/staging/wlan-ng/prism2usb.c:1:0:
   drivers/staging/wlan-ng/hfa384x_usb.c: In function 'hfa384x_drvr_enable':
>> drivers/staging/wlan-ng/hfa384x_usb.c:1784:16: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     if (!hw->isap && macport != 0 ||
         ~~~~~~~~~~^~~~~~~~~~~~~~~
--
   In file included from drivers/staging/wlan-ng/p80211netdev.c:91:0:
   drivers/staging/wlan-ng/cfg80211.c: In function 'prism2_connect':
>> drivers/staging/wlan-ng/cfg80211.c:479:51: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
         sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC && !is_wep)
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

vim +1784 drivers/staging/wlan-ng/hfa384x_usb.c

  1756	
  1757	/*----------------------------------------------------------------
  1758	 * hfa384x_drvr_enable
  1759	 *
  1760	 * Issues the enable command to enable communications on one of
  1761	 * the MACs 'ports'.  Only macport 0 is valid  for stations.
  1762	 * APs may also enable macports 1-6.  Only ports that are currently
  1763	 * disabled may be enabled.
  1764	 *
  1765	 * Arguments:
  1766	 *	hw		device structure
  1767	 *	macport		MAC port number
  1768	 *
  1769	 * Returns:
  1770	 *	0		success
  1771	 *	>0		f/w reported failure - f/w status code
  1772	 *	<0		driver reported error (timeout|bad arg)
  1773	 *
  1774	 * Side effects:
  1775	 *
  1776	 * Call context:
  1777	 *	process
  1778	 *----------------------------------------------------------------
  1779	 */
  1780	int hfa384x_drvr_enable(struct hfa384x *hw, u16 macport)
  1781	{
  1782		int result = 0;
  1783	
> 1784		if (!hw->isap && macport != 0 ||
  1785		    hw->isap && !(macport <= HFA384x_PORTID_MAX) ||
  1786		    hw->port_enabled[macport]) {
  1787			result = -EINVAL;
  1788		} else {
  1789			result = hfa384x_cmd_enable(hw, macport);
  1790			if (result == 0)
  1791				hw->port_enabled[macport] = 1;
  1792		}
  1793		return result;
  1794	}
  1795	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34774 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2] staging: wlan-ng: Remove unnecessary parentheses
  2017-10-17  1:48 ` [PATCH v2] " Frank A. Cancio Bello
@ 2017-10-18 14:17   ` Greg KH
  2017-10-18 14:46     ` Frank A. Cancio Bello
  2017-10-19 11:02   ` [PATCH v2] " kbuild test robot
  1 sibling, 1 reply; 14+ messages in thread
From: Greg KH @ 2017-10-18 14:17 UTC (permalink / raw)
  To: Frank A. Cancio Bello; +Cc: Julia.Lawall, pablo, devel, outreachy-kernel

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@generalsoftwareinc.com>
> ---
> 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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2] staging: wlan-ng: Remove unnecessary parentheses
  2017-10-18 14:17   ` Greg KH
@ 2017-10-18 14:46     ` Frank A. Cancio Bello
  2017-10-18 14:55       ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Frank A. Cancio Bello @ 2017-10-18 14:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Julia.Lawall, pablo, devel, outreachy-kernel

On Wed, Oct 18, 2017 at 04:17:04PM +0200, Greg KH wrote:
> 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@generalsoftwareinc.com>
> > ---
> > 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 || :(
> 

Thanks for your help Greg!
I agreed with you. I'm a newbie still learning the kernel code style.
When I run:
  perl scripts/checkpatch.pl -f drivers/staging/wlan-ng/cfg80211.c
I get the following warning:

CHECK: Unnecessary parentheses around 'wlandev->msdstate != WLAN_MSD_RUNNING'
#268: FILE: drivers/staging/wlan-ng/cfg80211.c:268:
+       if (!wlandev || (wlandev->msdstate != WLAN_MSD_RUNNING))

and that is why I proposed the change.

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

Is OK to say that in cases of newline after the || parentheses could be 
removed without affect code clarity?

Would you accept a v3 of this patch that just removes parentheses in those
cases? Or you prefer to drop this patch?

cheers
frank


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2] staging: wlan-ng: Remove unnecessary parentheses
  2017-10-18 14:46     ` Frank A. Cancio Bello
@ 2017-10-18 14:55       ` Greg KH
  2017-10-18 15:48         ` [PATCH v3] " Frank A. Cancio Bello
  0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2017-10-18 14:55 UTC (permalink / raw)
  To: Frank A. Cancio Bello; +Cc: Julia.Lawall, pablo, devel, outreachy-kernel

On Wed, Oct 18, 2017 at 10:46:09AM -0400, Frank A. Cancio Bello wrote:
> On Wed, Oct 18, 2017 at 04:17:04PM +0200, Greg KH wrote:
> > 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@generalsoftwareinc.com>
> > > ---
> > > 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 || :(
> > 
> 
> Thanks for your help Greg!
> I agreed with you. I'm a newbie still learning the kernel code style.
> When I run:
>   perl scripts/checkpatch.pl -f drivers/staging/wlan-ng/cfg80211.c
> I get the following warning:
> 
> CHECK: Unnecessary parentheses around 'wlandev->msdstate != WLAN_MSD_RUNNING'
> #268: FILE: drivers/staging/wlan-ng/cfg80211.c:268:
> +       if (!wlandev || (wlandev->msdstate != WLAN_MSD_RUNNING))
> 
> and that is why I proposed the change.

checkpatch is a hint, it's not always correct :)

> > Please don't make things such that it is harder to read for a
> > programmer.
> > 
> 
> Is OK to say that in cases of newline after the || parentheses could be 
> removed without affect code clarity?
> 
> Would you accept a v3 of this patch that just removes parentheses in those
> cases? Or you prefer to drop this patch?

I've already dropped this, if you have other changes in this patch that
do not make things harder to understand, please fix up and resend.

thanks,

greg k-h


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v3] staging: wlan-ng: Remove unnecessary parentheses
  2017-10-18 14:55       ` Greg KH
@ 2017-10-18 15:48         ` Frank A. Cancio Bello
  2017-10-18 21:40           ` Tobin C. Harding
  0 siblings, 1 reply; 14+ messages in thread
From: Frank A. Cancio Bello @ 2017-10-18 15:48 UTC (permalink / raw)
  To: gregkh, Julia.Lawall, pablo; +Cc: outreachy-kernel, devel

Remove unnecessary parentheses to comply with preferred coding style for
the linux kernel and avoid the following checkpatch's messages:
'CHECK: Unnecessary parentheses around'
'CHECK: Logical continuations should be on the previous line'

Credits to checkpatch.

Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>
---
Changes in v3:
	* Exclude any parentheses removal that makes unclear the order of the operations.

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/p80211req.c  |  2 +-
 drivers/staging/wlan-ng/prism2fw.c   | 21 ++++++++++-----------
 drivers/staging/wlan-ng/prism2mgmt.c | 23 +++++++++++------------
 drivers/staging/wlan-ng/prism2sta.c  |  4 ++--
 4 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211req.c b/drivers/staging/wlan-ng/p80211req.c
index afe8477..0d1556c 100644
--- a/drivers/staging/wlan-ng/p80211req.c
+++ b/drivers/staging/wlan-ng/p80211req.c
@@ -124,7 +124,7 @@ int p80211req_dorequest(struct wlandevice *wlandev, u8 *msgbuf)
 
 	/* Check Permissions */
 	if (!capable(CAP_NET_ADMIN) &&
-	    (msg->msgcode != DIDmsg_dot11req_mibget)) {
+	    msg->msgcode != DIDmsg_dot11req_mibget) {
 		netdev_err(wlandev->netdev,
 			   "%s: only dot11req_mibget allowed for non-root.\n",
 			   wlandev->name);
diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index 344bec8..7c2e9c4 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -1177,8 +1177,8 @@ static int validate_identity(void)
 				 s3info[i].info.compat.top);
 
 			/* MAC compat range */
-			if ((s3info[i].info.compat.role == 1) &&
-			    (s3info[i].info.compat.id == 2)) {
+			if (s3info[i].info.compat.role == 1 &&
+			    s3info[i].info.compat.id == 2) {
 				if (s3info[i].info.compat.variant !=
 				    macid.variant) {
 					result = 2;
@@ -1186,17 +1186,16 @@ static int validate_identity(void)
 			}
 
 			/* PRI compat range */
-			if ((s3info[i].info.compat.role == 1) &&
-			    (s3info[i].info.compat.id == 3)) {
-				if ((s3info[i].info.compat.bottom > priid.top)
-				    || (s3info[i].info.compat.top <
-					priid.bottom)) {
+			if (s3info[i].info.compat.role == 1 &&
+			    s3info[i].info.compat.id == 3) {
+				if (s3info[i].info.compat.bottom > priid.top ||
+				    s3info[i].info.compat.top < priid.bottom) {
 					result = 3;
 				}
 			}
 			/* SEC compat range */
-			if ((s3info[i].info.compat.role == 1) &&
-			    (s3info[i].info.compat.id == 4)) {
+			if (s3info[i].info.compat.role == 1 &&
+			    s3info[i].info.compat.id == 4) {
 				/* FIXME: isn't something missing here? */
 			}
 
@@ -1218,8 +1217,8 @@ static int validate_identity(void)
 				continue;
 			if (nicid.minor != s3info[i].info.version.minor)
 				continue;
-			if ((nicid.variant != s3info[i].info.version.variant) &&
-			    (nicid.id != 0x8008))
+			if (nicid.variant != s3info[i].info.version.variant &&
+			    nicid.id != 0x8008)
 				continue;
 
 			trump = 1;
diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
index 7207059..97ab6d7 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -1256,10 +1256,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
 				     word, result);
 				goto failed;
 			}
-			if ((msg->keepwepflags.status ==
-			     P80211ENUM_msgitem_status_data_ok)
-			    && (msg->keepwepflags.data !=
-				P80211ENUM_truth_true)) {
+			if (msg->keepwepflags.status ==
+			     P80211ENUM_msgitem_status_data_ok &&
+			    msg->keepwepflags.data != P80211ENUM_truth_true) {
 				/* Set the wepflags for no decryption */
 				word = HFA384x_WEPFLAGS_DISABLE_TXCRYPT |
 				    HFA384x_WEPFLAGS_DISABLE_RXCRYPT;
@@ -1279,8 +1278,8 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
 		}
 
 		/* Do we want to strip the FCS in monitor mode? */
-		if ((msg->stripfcs.status == P80211ENUM_msgitem_status_data_ok)
-		    && (msg->stripfcs.data == P80211ENUM_truth_true)) {
+		if (msg->stripfcs.status == P80211ENUM_msgitem_status_data_ok &&
+		    msg->stripfcs.data == P80211ENUM_truth_true) {
 			hw->sniff_fcs = 0;
 		} else {
 			hw->sniff_fcs = 1;
@@ -1317,14 +1316,14 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
 
 		/* Set the driver state */
 		/* Do we want the prism2 header? */
-		if ((msg->prismheader.status ==
-		     P80211ENUM_msgitem_status_data_ok) &&
-		    (msg->prismheader.data == P80211ENUM_truth_true)) {
+		if (msg->prismheader.status ==
+		     P80211ENUM_msgitem_status_data_ok &&
+		    msg->prismheader.data == P80211ENUM_truth_true) {
 			hw->sniffhdr = 0;
 			wlandev->netdev->type = ARPHRD_IEEE80211_PRISM;
-		} else if ((msg->wlanheader.status ==
-			    P80211ENUM_msgitem_status_data_ok) &&
-			   (msg->wlanheader.data == P80211ENUM_truth_true)) {
+		} else if (msg->wlanheader.status ==
+			    P80211ENUM_msgitem_status_data_ok &&
+			   msg->wlanheader.data == P80211ENUM_truth_true) {
 			hw->sniffhdr = 1;
 			wlandev->netdev->type = ARPHRD_IEEE80211_PRISM;
 		} else {
diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c
index 070a237..38956fb 100644
--- a/drivers/staging/wlan-ng/prism2sta.c
+++ b/drivers/staging/wlan-ng/prism2sta.c
@@ -1929,8 +1929,8 @@ void prism2sta_commsqual_defer(struct work_struct *data)
 		return;
 
 	/* we don't care if we're in AP mode */
-	if ((wlandev->macmode == WLAN_MACMODE_NONE) ||
-	    (wlandev->macmode == WLAN_MACMODE_ESS_AP)) {
+	if (wlandev->macmode == WLAN_MACMODE_NONE ||
+	    wlandev->macmode == WLAN_MACMODE_ESS_AP) {
 		return;
 	}
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v3] staging: wlan-ng: Remove unnecessary parentheses
  2017-10-18 15:48         ` [PATCH v3] " Frank A. Cancio Bello
@ 2017-10-18 21:40           ` Tobin C. Harding
  2017-10-18 22:50             ` Frank A. Cancio Bello
  0 siblings, 1 reply; 14+ messages in thread
From: Tobin C. Harding @ 2017-10-18 21:40 UTC (permalink / raw)
  To: Frank A. Cancio Bello
  Cc: gregkh, Julia.Lawall, pablo, devel, outreachy-kernel

On Wed, Oct 18, 2017 at 11:48:21AM -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 messages:
> 'CHECK: Unnecessary parentheses around'
> 'CHECK: Logical continuations should be on the previous line'
> 
> Credits to checkpatch.
> 
> Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>
> ---
> Changes in v3:
> 	* Exclude any parentheses removal that makes unclear the order of the operations.
> 
> 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/p80211req.c  |  2 +-
>  drivers/staging/wlan-ng/prism2fw.c   | 21 ++++++++++-----------
>  drivers/staging/wlan-ng/prism2mgmt.c | 23 +++++++++++------------
>  drivers/staging/wlan-ng/prism2sta.c  |  4 ++--
>  4 files changed, 24 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/p80211req.c b/drivers/staging/wlan-ng/p80211req.c
> index afe8477..0d1556c 100644
> --- a/drivers/staging/wlan-ng/p80211req.c
> +++ b/drivers/staging/wlan-ng/p80211req.c
> @@ -124,7 +124,7 @@ int p80211req_dorequest(struct wlandevice *wlandev, u8 *msgbuf)
>  
>  	/* Check Permissions */
>  	if (!capable(CAP_NET_ADMIN) &&
> -	    (msg->msgcode != DIDmsg_dot11req_mibget)) {
> +	    msg->msgcode != DIDmsg_dot11req_mibget) {

While this is not making the code _harder_ to read, it is not making it any easier either. So all
the change is really doing is quieting checkpatch. Usually it is not a good idea to make code
changes _just_ to quieten a static analysis tool. It's just a tool remember, there to help us write
better code.

On top of that CHECKS are just that, things that should be CHECK'ed, not necessarily fixed.

Hope this helps,
Tobin.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3] staging: wlan-ng: Remove unnecessary parentheses
  2017-10-18 21:40           ` Tobin C. Harding
@ 2017-10-18 22:50             ` Frank A. Cancio Bello
  2017-10-19  1:38               ` Tobin C. Harding
  0 siblings, 1 reply; 14+ messages in thread
From: Frank A. Cancio Bello @ 2017-10-18 22:50 UTC (permalink / raw)
  To: Tobin C. Harding; +Cc: gregkh, Julia.Lawall, pablo, devel, outreachy-kernel

On Thu, Oct 19, 2017 at 08:40:08AM +1100, Tobin C. Harding wrote:
> On Wed, Oct 18, 2017 at 11:48:21AM -0400, Frank A. Cancio Bello wrote:
> > --- a/drivers/staging/wlan-ng/p80211req.c
> > +++ b/drivers/staging/wlan-ng/p80211req.c
> > @@ -124,7 +124,7 @@ int p80211req_dorequest(struct wlandevice *wlandev, u8 *msgbuf)
> >  
> >  	/* Check Permissions */
> >  	if (!capable(CAP_NET_ADMIN) &&
> > -	    (msg->msgcode != DIDmsg_dot11req_mibget)) {
> > +	    msg->msgcode != DIDmsg_dot11req_mibget) {
> 
> While this is not making the code _harder_ to read, it is not making it any easier either. So all
> the change is really doing is quieting checkpatch. Usually it is not a good idea to make code
> changes _just_ to quieten a static analysis tool. It's just a tool remember, there to help us write
> better code.
> 

For me is easy to read without parentheses given the fact that I tend to jump to the closing parentheses and then read from the opening parentheses up to the mental mark that I did at the closing parentheses. But that is me, and given the fact that I'm a newbie that is still learning I will stop sending this kind of patches if you consider it wise.

> On top of that CHECKS are just that, things that should be CHECK'ed, not necessarily fixed.
> 

Agreed.

> Hope this helps,

A lot! I really appreciate any input at this stage.

thanks,
frank


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3] staging: wlan-ng: Remove unnecessary parentheses
  2017-10-18 22:50             ` Frank A. Cancio Bello
@ 2017-10-19  1:38               ` Tobin C. Harding
  0 siblings, 0 replies; 14+ messages in thread
From: Tobin C. Harding @ 2017-10-19  1:38 UTC (permalink / raw)
  To: Frank A. Cancio Bello
  Cc: gregkh, Julia.Lawall, pablo, devel, outreachy-kernel

On Wed, Oct 18, 2017 at 06:50:52PM -0400, Frank A. Cancio Bello wrote:
> On Thu, Oct 19, 2017 at 08:40:08AM +1100, Tobin C. Harding wrote:
> > On Wed, Oct 18, 2017 at 11:48:21AM -0400, Frank A. Cancio Bello wrote:
> > > --- a/drivers/staging/wlan-ng/p80211req.c
> > > +++ b/drivers/staging/wlan-ng/p80211req.c
> > > @@ -124,7 +124,7 @@ int p80211req_dorequest(struct wlandevice *wlandev, u8 *msgbuf)
> > >  
> > >  	/* Check Permissions */
> > >  	if (!capable(CAP_NET_ADMIN) &&
> > > -	    (msg->msgcode != DIDmsg_dot11req_mibget)) {
> > > +	    msg->msgcode != DIDmsg_dot11req_mibget) {
> > 
> > While this is not making the code _harder_ to read, it is not making it any easier either. So all
> > the change is really doing is quieting checkpatch. Usually it is not a good idea to make code
> > changes _just_ to quieten a static analysis tool. It's just a tool remember, there to help us write
> > better code.
> > 
> 
> For me is easy to read without parentheses given the fact that I tend to jump to the closing parentheses and then read from the opening parentheses up to the mental mark that I did at the closing parentheses. But that is me, and given the fact that I'm a newbie that is still learning I will stop sending this kind of patches if you consider it wise.
> 
> > On top of that CHECKS are just that, things that should be CHECK'ed, not necessarily fixed.
> > 
> 
> Agreed.
> 
> > Hope this helps,
> 
> A lot! I really appreciate any input at this stage.

Glad to help, stick at it. You will get there.

> 
> thanks,
> frank


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2] staging: wlan-ng: Remove unnecessary parentheses
  2017-10-17  1:48 ` [PATCH v2] " Frank A. Cancio Bello
  2017-10-18 14:17   ` Greg KH
@ 2017-10-19 11:02   ` kbuild test robot
  1 sibling, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2017-10-19 11:02 UTC (permalink / raw)
  To: Frank A. Cancio Bello
  Cc: kbuild-all, Julia.Lawall, pablo, devel, gregkh, outreachy-kernel

[-- Attachment #1: Type: text/plain, Size: 6185 bytes --]

Hi Frank,

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.14-rc5 next-20171018]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Frank-A-Cancio-Bello/staging-wlan-ng-Remove-unnecessary-parentheses/20171018-202349
config: i386-randconfig-b0-10191645 (attached as .config)
compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/linux/list.h:4,
                    from include/linux/module.h:9,
                    from drivers/staging/wlan-ng/hfa384x_usb.c:113,
                    from drivers/staging/wlan-ng/prism2usb.c:1:
   drivers/staging/wlan-ng/hfa384x_usb.c: In function 'hfa384x_drvr_enable':
   drivers/staging/wlan-ng/hfa384x_usb.c:1784:16: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     if (!hw->isap && macport != 0 ||
                   ^
   include/linux/compiler.h:156:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^
>> drivers/staging/wlan-ng/hfa384x_usb.c:1784:2: note: in expansion of macro 'if'
     if (!hw->isap && macport != 0 ||
     ^
   drivers/staging/wlan-ng/hfa384x_usb.c:1784:16: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     if (!hw->isap && macport != 0 ||
                   ^
   include/linux/compiler.h:156:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^
>> drivers/staging/wlan-ng/hfa384x_usb.c:1784:2: note: in expansion of macro 'if'
     if (!hw->isap && macport != 0 ||
     ^
   drivers/staging/wlan-ng/hfa384x_usb.c:1784:16: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     if (!hw->isap && macport != 0 ||
                   ^
   include/linux/compiler.h:167:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^
>> drivers/staging/wlan-ng/hfa384x_usb.c:1784:2: note: in expansion of macro 'if'
     if (!hw->isap && macport != 0 ||
     ^
--
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/linux/list.h:4,
                    from include/linux/module.h:9,
                    from drivers/staging/wlan-ng/p80211netdev.c:52:
   drivers/staging/wlan-ng/cfg80211.c: In function 'prism2_connect':
   drivers/staging/wlan-ng/cfg80211.c:479:51: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
         sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC && !is_wep)
                                                      ^
   include/linux/compiler.h:156:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^
>> drivers/staging/wlan-ng/cfg80211.c:478:2: note: in expansion of macro 'if'
     if (sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM ||
     ^
   drivers/staging/wlan-ng/cfg80211.c:479:51: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
         sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC && !is_wep)
                                                      ^
   include/linux/compiler.h:156:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^
>> drivers/staging/wlan-ng/cfg80211.c:478:2: note: in expansion of macro 'if'
     if (sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM ||
     ^
   drivers/staging/wlan-ng/cfg80211.c:479:51: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
         sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC && !is_wep)
                                                      ^
   include/linux/compiler.h:167:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^
>> drivers/staging/wlan-ng/cfg80211.c:478:2: note: in expansion of macro 'if'
     if (sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM ||
     ^

vim +/if +1784 drivers/staging/wlan-ng/hfa384x_usb.c

  1756	
  1757	/*----------------------------------------------------------------
  1758	 * hfa384x_drvr_enable
  1759	 *
  1760	 * Issues the enable command to enable communications on one of
  1761	 * the MACs 'ports'.  Only macport 0 is valid  for stations.
  1762	 * APs may also enable macports 1-6.  Only ports that are currently
  1763	 * disabled may be enabled.
  1764	 *
  1765	 * Arguments:
  1766	 *	hw		device structure
  1767	 *	macport		MAC port number
  1768	 *
  1769	 * Returns:
  1770	 *	0		success
  1771	 *	>0		f/w reported failure - f/w status code
  1772	 *	<0		driver reported error (timeout|bad arg)
  1773	 *
  1774	 * Side effects:
  1775	 *
  1776	 * Call context:
  1777	 *	process
  1778	 *----------------------------------------------------------------
  1779	 */
  1780	int hfa384x_drvr_enable(struct hfa384x *hw, u16 macport)
  1781	{
  1782		int result = 0;
  1783	
> 1784		if (!hw->isap && macport != 0 ||
  1785		    hw->isap && !(macport <= HFA384x_PORTID_MAX) ||
  1786		    hw->port_enabled[macport]) {
  1787			result = -EINVAL;
  1788		} else {
  1789			result = hfa384x_cmd_enable(hw, macport);
  1790			if (result == 0)
  1791				hw->port_enabled[macport] = 1;
  1792		}
  1793		return result;
  1794	}
  1795	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33081 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-10-19 11:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16 18:26 [PATCH] staging: wlan-ng: Remove unnecessary parentheses Frank A. Cancio Bello
2017-10-16 20:18 ` [Outreachy kernel] " Julia Lawall
2017-10-16 21:45   ` Frank A. Cancio Bello
2017-10-16 21:47     ` Julia Lawall
2017-10-17  1:48 ` [PATCH v2] " Frank A. Cancio Bello
2017-10-18 14:17   ` Greg KH
2017-10-18 14:46     ` Frank A. Cancio Bello
2017-10-18 14:55       ` Greg KH
2017-10-18 15:48         ` [PATCH v3] " Frank A. Cancio Bello
2017-10-18 21:40           ` Tobin C. Harding
2017-10-18 22:50             ` Frank A. Cancio Bello
2017-10-19  1:38               ` Tobin C. Harding
2017-10-19 11:02   ` [PATCH v2] " kbuild test robot
2017-10-18 10:45 ` [PATCH] " kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.