rtlwifi: Fix static checker warnings for various drivers
authorLarry Finger <Larry.Finger@lwfinger.net>
Thu, 2 Oct 2014 17:00:54 +0000 (12:00 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 2 Oct 2014 18:26:32 +0000 (14:26 -0400)
Indenting errors yielded the following static checker warnings:

drivers/net/wireless/rtlwifi/rtl8192ee/hw.c:533 rtl92ee_set_hw_reg() warn: add curly braces? (if)
drivers/net/wireless/rtlwifi/rtl8192ee/hw.c:539 rtl92ee_set_hw_reg() warn: add curly braces? (if)

An unreleased version of the static checker also reported:

drivers/net/wireless/rtlwifi/rtl8723be/trx.c:550 rtl8723be_rx_query_desc() warn: 'hdr' can't be NULL.
drivers/net/wireless/rtlwifi/rtl8188ee/trx.c:621 rtl88ee_rx_query_desc() warn: 'hdr' can't be NULL.
drivers/net/wireless/rtlwifi/rtl8192ee/trx.c:567 rtl92ee_rx_query_desc() warn: 'hdr' can't be NULL.
drivers/net/wireless/rtlwifi/rtl8821ae/trx.c:758 rtl8821ae_rx_query_desc() warn: 'hdr' can't be NULL.
drivers/net/wireless/rtlwifi/rtl8723ae/trx.c:494 rtl8723e_rx_query_desc() warn: 'hdr' can't be NULL.
drivers/net/wireless/rtlwifi/rtl8192se/trx.c:315 rtl92se_rx_query_desc() warn: 'hdr' can't be NULL.
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c:392 rtl92ce_rx_query_desc() warn: 'hdr' can't be NULL.

All of these are fixed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/rtl8188ee/trx.c
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
drivers/net/wireless/rtlwifi/rtl8192ee/hw.c
drivers/net/wireless/rtlwifi/rtl8192ee/trx.c
drivers/net/wireless/rtlwifi/rtl8192se/trx.c
drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
drivers/net/wireless/rtlwifi/rtl8723be/trx.c
drivers/net/wireless/rtlwifi/rtl8821ae/trx.c

index cf56ec8791bab97268685d53a93b3b19110751b8..df549c96adef9bec920ef1165be1ced6ea127504 100644 (file)
@@ -618,13 +618,6 @@ bool rtl88ee_rx_query_desc(struct ieee80211_hw *hw,
         * to decrypt it
         */
        if (status->decrypted) {
-               if (!hdr) {
-                       WARN_ON_ONCE(true);
-                       pr_err("decrypted is true but hdr NULL, from skb %p\n",
-                              rtl_get_hdr(skb));
-                       return false;
-               }
-
                if ((!_ieee80211_is_robust_mgmt_frame(hdr)) &&
                    (ieee80211_has_protected(hdr->frame_control)))
                        rx_status->flag |= RX_FLAG_DECRYPTED;
index c14012330900035f3b738e827d536cb963e9f631..2fb9c7acb76a3bf7d6fa1feee728b15365b86207 100644 (file)
@@ -389,10 +389,6 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
         * to decrypt it
         */
        if (stats->decrypted) {
-               if (!hdr) {
-                       /* In testing, hdr was NULL here */
-                       return false;
-               }
                if ((_ieee80211_is_robust_mgmt_frame(hdr)) &&
                    (ieee80211_has_protected(hdr->frame_control)))
                        rx_status->flag &= ~RX_FLAG_DECRYPTED;
index 85d0d58079a6341952959445d841a8cffd623b32..dfdc9b20e4ad4d868012c80f4233559e58050052 100644 (file)
@@ -530,18 +530,18 @@ void rtl92ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
                        fac = (1 << (fac + 2));
                        if (fac > 0xf)
                                fac = 0xf;
-                               for (i = 0; i < 4; i++) {
-                                       if ((reg[i] & 0xf0) > (fac << 4))
-                                               reg[i] = (reg[i] & 0x0f) |
-                                                       (fac << 4);
-                                       if ((reg[i] & 0x0f) > fac)
-                                               reg[i] = (reg[i] & 0xf0) | fac;
-                                               rtl_write_byte(rtlpriv,
-                                                      (REG_AGGLEN_LMT + i),
-                                                      reg[i]);
-                               }
-                               RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
-                                        "Set HW_VAR_AMPDU_FACTOR:%#x\n", fac);
+                       for (i = 0; i < 4; i++) {
+                               if ((reg[i] & 0xf0) > (fac << 4))
+                                       reg[i] = (reg[i] & 0x0f) |
+                                               (fac << 4);
+                               if ((reg[i] & 0x0f) > fac)
+                                       reg[i] = (reg[i] & 0xf0) | fac;
+                               rtl_write_byte(rtlpriv,
+                                              (REG_AGGLEN_LMT + i),
+                                              reg[i]);
+                       }
+                       RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
+                                "Set HW_VAR_AMPDU_FACTOR:%#x\n", fac);
                }
                }
                break;
index 83edd9525e5e9b569d283191c489a6de1f361df1..2fcbef1d029fa5e9c337926a7cb3005ffe979a63 100644 (file)
@@ -564,13 +564,6 @@ bool rtl92ee_rx_query_desc(struct ieee80211_hw *hw,
         * to decrypt it
         */
        if (status->decrypted) {
-               if (!hdr) {
-                       WARN_ON_ONCE(true);
-                       pr_err("decrypted is true but hdr NULL, from skb %p\n",
-                              rtl_get_hdr(skb));
-                       return false;
-               }
-
                if ((!_ieee80211_is_robust_mgmt_frame(hdr)) &&
                    (ieee80211_has_protected(hdr->frame_control)))
                        rx_status->flag |= RX_FLAG_DECRYPTED;
index 2b3c78baa9f8b3742020aa377b0449785eeb8ab7..b358ebce8942127413105b39e3799006d559eed8 100644 (file)
@@ -312,10 +312,6 @@ bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
                hdr = (struct ieee80211_hdr *)(skb->data +
                       stats->rx_drvinfo_size + stats->rx_bufshift);
 
-               if (!hdr) {
-                       /* during testing, hdr was NULL here */
-                       return false;
-               }
                if ((_ieee80211_is_robust_mgmt_frame(hdr)) &&
                        (ieee80211_has_protected(hdr->frame_control)))
                        rx_status->flag &= ~RX_FLAG_DECRYPTED;
index 1da2367ef37ed636dad1e79f90fd3cee326c1547..d372ccaf3465e062e173ef531e2e5501e58eab51 100644 (file)
@@ -491,12 +491,6 @@ bool rtl8723e_rx_query_desc(struct ieee80211_hw *hw,
         * to decrypt it
         */
        if (status->decrypted) {
-               if (!hdr) {
-                       WARN_ON_ONCE(true);
-                       pr_err("decrypted is true but hdr NULL, from skb %p\n",
-                              rtl_get_hdr(skb));
-                       return false;
-               }
                if ((!_ieee80211_is_robust_mgmt_frame(hdr)) &&
                    (ieee80211_has_protected(hdr->frame_control)))
                        rx_status->flag |= RX_FLAG_DECRYPTED;
index 9679cd207fad38633b0cf4299cd9fba2c6453be7..d6a1c70cb657ba692fa93c43b87315224429c071 100644 (file)
@@ -547,13 +547,6 @@ bool rtl8723be_rx_query_desc(struct ieee80211_hw *hw,
         * to decrypt it
         */
        if (status->decrypted) {
-               if (!hdr) {
-                       WARN_ON_ONCE(true);
-                       pr_err("decrypted is true but hdr NULL, from skb %p\n",
-                              rtl_get_hdr(skb));
-                       return false;
-               }
-
                if ((!_ieee80211_is_robust_mgmt_frame(hdr)) &&
                    (ieee80211_has_protected(hdr->frame_control)))
                        rx_status->flag |= RX_FLAG_DECRYPTED;
index 7ece0efc6d3bc1d59afccfca5241fedc278622f8..383b86b05cba17531cac2b5428015fc78cee69f9 100644 (file)
@@ -755,13 +755,6 @@ bool rtl8821ae_rx_query_desc(struct ieee80211_hw *hw,
         * to decrypt it
         */
        if (status->decrypted) {
-               if (!hdr) {
-                       WARN_ON_ONCE(true);
-                       pr_err("decrypted is true but hdr NULL, from skb %p\n",
-                              rtl_get_hdr(skb));
-                       return false;
-               }
-
                if ((!_ieee80211_is_robust_mgmt_frame(hdr)) &&
                    (ieee80211_has_protected(hdr->frame_control)))
                        rx_status->flag |= RX_FLAG_DECRYPTED;