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 <fr...@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

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to