diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2014-10-02 13:00:54 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-10-02 14:26:32 -0400 |
commit | 3f08e47291879fb047d7d4464d2beaedfea4eb63 (patch) | |
tree | 64e98b0943bca586d52fc874e2efbe63a05eb097 | |
parent | 989377e1cc9e713822d148d2e638d6c63d8a94b1 (diff) |
rtlwifi: Fix static checker warnings for various drivers
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>
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8188ee/trx.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ee/hw.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ee/trx.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192se/trx.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8723ae/trx.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8723be/trx.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8821ae/trx.c | 7 |
8 files changed, 12 insertions, 54 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c b/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c index cf56ec8791ba..df549c96adef 100644 --- a/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c | |||
@@ -618,13 +618,6 @@ bool rtl88ee_rx_query_desc(struct ieee80211_hw *hw, | |||
618 | * to decrypt it | 618 | * to decrypt it |
619 | */ | 619 | */ |
620 | if (status->decrypted) { | 620 | if (status->decrypted) { |
621 | if (!hdr) { | ||
622 | WARN_ON_ONCE(true); | ||
623 | pr_err("decrypted is true but hdr NULL, from skb %p\n", | ||
624 | rtl_get_hdr(skb)); | ||
625 | return false; | ||
626 | } | ||
627 | |||
628 | if ((!_ieee80211_is_robust_mgmt_frame(hdr)) && | 621 | if ((!_ieee80211_is_robust_mgmt_frame(hdr)) && |
629 | (ieee80211_has_protected(hdr->frame_control))) | 622 | (ieee80211_has_protected(hdr->frame_control))) |
630 | rx_status->flag |= RX_FLAG_DECRYPTED; | 623 | rx_status->flag |= RX_FLAG_DECRYPTED; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c index c14012330900..2fb9c7acb76a 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | |||
@@ -389,10 +389,6 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw, | |||
389 | * to decrypt it | 389 | * to decrypt it |
390 | */ | 390 | */ |
391 | if (stats->decrypted) { | 391 | if (stats->decrypted) { |
392 | if (!hdr) { | ||
393 | /* In testing, hdr was NULL here */ | ||
394 | return false; | ||
395 | } | ||
396 | if ((_ieee80211_is_robust_mgmt_frame(hdr)) && | 392 | if ((_ieee80211_is_robust_mgmt_frame(hdr)) && |
397 | (ieee80211_has_protected(hdr->frame_control))) | 393 | (ieee80211_has_protected(hdr->frame_control))) |
398 | rx_status->flag &= ~RX_FLAG_DECRYPTED; | 394 | rx_status->flag &= ~RX_FLAG_DECRYPTED; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ee/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ee/hw.c index 85d0d58079a6..dfdc9b20e4ad 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ee/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ee/hw.c | |||
@@ -530,18 +530,18 @@ void rtl92ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) | |||
530 | fac = (1 << (fac + 2)); | 530 | fac = (1 << (fac + 2)); |
531 | if (fac > 0xf) | 531 | if (fac > 0xf) |
532 | fac = 0xf; | 532 | fac = 0xf; |
533 | for (i = 0; i < 4; i++) { | 533 | for (i = 0; i < 4; i++) { |
534 | if ((reg[i] & 0xf0) > (fac << 4)) | 534 | if ((reg[i] & 0xf0) > (fac << 4)) |
535 | reg[i] = (reg[i] & 0x0f) | | 535 | reg[i] = (reg[i] & 0x0f) | |
536 | (fac << 4); | 536 | (fac << 4); |
537 | if ((reg[i] & 0x0f) > fac) | 537 | if ((reg[i] & 0x0f) > fac) |
538 | reg[i] = (reg[i] & 0xf0) | fac; | 538 | reg[i] = (reg[i] & 0xf0) | fac; |
539 | rtl_write_byte(rtlpriv, | 539 | rtl_write_byte(rtlpriv, |
540 | (REG_AGGLEN_LMT + i), | 540 | (REG_AGGLEN_LMT + i), |
541 | reg[i]); | 541 | reg[i]); |
542 | } | 542 | } |
543 | RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, | 543 | RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, |
544 | "Set HW_VAR_AMPDU_FACTOR:%#x\n", fac); | 544 | "Set HW_VAR_AMPDU_FACTOR:%#x\n", fac); |
545 | } | 545 | } |
546 | } | 546 | } |
547 | break; | 547 | break; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ee/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ee/trx.c index 83edd9525e5e..2fcbef1d029f 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ee/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ee/trx.c | |||
@@ -564,13 +564,6 @@ bool rtl92ee_rx_query_desc(struct ieee80211_hw *hw, | |||
564 | * to decrypt it | 564 | * to decrypt it |
565 | */ | 565 | */ |
566 | if (status->decrypted) { | 566 | if (status->decrypted) { |
567 | if (!hdr) { | ||
568 | WARN_ON_ONCE(true); | ||
569 | pr_err("decrypted is true but hdr NULL, from skb %p\n", | ||
570 | rtl_get_hdr(skb)); | ||
571 | return false; | ||
572 | } | ||
573 | |||
574 | if ((!_ieee80211_is_robust_mgmt_frame(hdr)) && | 567 | if ((!_ieee80211_is_robust_mgmt_frame(hdr)) && |
575 | (ieee80211_has_protected(hdr->frame_control))) | 568 | (ieee80211_has_protected(hdr->frame_control))) |
576 | rx_status->flag |= RX_FLAG_DECRYPTED; | 569 | rx_status->flag |= RX_FLAG_DECRYPTED; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c index 2b3c78baa9f8..b358ebce8942 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c | |||
@@ -312,10 +312,6 @@ bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats, | |||
312 | hdr = (struct ieee80211_hdr *)(skb->data + | 312 | hdr = (struct ieee80211_hdr *)(skb->data + |
313 | stats->rx_drvinfo_size + stats->rx_bufshift); | 313 | stats->rx_drvinfo_size + stats->rx_bufshift); |
314 | 314 | ||
315 | if (!hdr) { | ||
316 | /* during testing, hdr was NULL here */ | ||
317 | return false; | ||
318 | } | ||
319 | if ((_ieee80211_is_robust_mgmt_frame(hdr)) && | 315 | if ((_ieee80211_is_robust_mgmt_frame(hdr)) && |
320 | (ieee80211_has_protected(hdr->frame_control))) | 316 | (ieee80211_has_protected(hdr->frame_control))) |
321 | rx_status->flag &= ~RX_FLAG_DECRYPTED; | 317 | rx_status->flag &= ~RX_FLAG_DECRYPTED; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c index 1da2367ef37e..d372ccaf3465 100644 --- a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c | |||
@@ -491,12 +491,6 @@ bool rtl8723e_rx_query_desc(struct ieee80211_hw *hw, | |||
491 | * to decrypt it | 491 | * to decrypt it |
492 | */ | 492 | */ |
493 | if (status->decrypted) { | 493 | if (status->decrypted) { |
494 | if (!hdr) { | ||
495 | WARN_ON_ONCE(true); | ||
496 | pr_err("decrypted is true but hdr NULL, from skb %p\n", | ||
497 | rtl_get_hdr(skb)); | ||
498 | return false; | ||
499 | } | ||
500 | if ((!_ieee80211_is_robust_mgmt_frame(hdr)) && | 494 | if ((!_ieee80211_is_robust_mgmt_frame(hdr)) && |
501 | (ieee80211_has_protected(hdr->frame_control))) | 495 | (ieee80211_has_protected(hdr->frame_control))) |
502 | rx_status->flag |= RX_FLAG_DECRYPTED; | 496 | rx_status->flag |= RX_FLAG_DECRYPTED; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/trx.c b/drivers/net/wireless/rtlwifi/rtl8723be/trx.c index 9679cd207fad..d6a1c70cb657 100644 --- a/drivers/net/wireless/rtlwifi/rtl8723be/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8723be/trx.c | |||
@@ -547,13 +547,6 @@ bool rtl8723be_rx_query_desc(struct ieee80211_hw *hw, | |||
547 | * to decrypt it | 547 | * to decrypt it |
548 | */ | 548 | */ |
549 | if (status->decrypted) { | 549 | if (status->decrypted) { |
550 | if (!hdr) { | ||
551 | WARN_ON_ONCE(true); | ||
552 | pr_err("decrypted is true but hdr NULL, from skb %p\n", | ||
553 | rtl_get_hdr(skb)); | ||
554 | return false; | ||
555 | } | ||
556 | |||
557 | if ((!_ieee80211_is_robust_mgmt_frame(hdr)) && | 550 | if ((!_ieee80211_is_robust_mgmt_frame(hdr)) && |
558 | (ieee80211_has_protected(hdr->frame_control))) | 551 | (ieee80211_has_protected(hdr->frame_control))) |
559 | rx_status->flag |= RX_FLAG_DECRYPTED; | 552 | rx_status->flag |= RX_FLAG_DECRYPTED; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/trx.c b/drivers/net/wireless/rtlwifi/rtl8821ae/trx.c index 7ece0efc6d3b..383b86b05cba 100644 --- a/drivers/net/wireless/rtlwifi/rtl8821ae/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8821ae/trx.c | |||
@@ -755,13 +755,6 @@ bool rtl8821ae_rx_query_desc(struct ieee80211_hw *hw, | |||
755 | * to decrypt it | 755 | * to decrypt it |
756 | */ | 756 | */ |
757 | if (status->decrypted) { | 757 | if (status->decrypted) { |
758 | if (!hdr) { | ||
759 | WARN_ON_ONCE(true); | ||
760 | pr_err("decrypted is true but hdr NULL, from skb %p\n", | ||
761 | rtl_get_hdr(skb)); | ||
762 | return false; | ||
763 | } | ||
764 | |||
765 | if ((!_ieee80211_is_robust_mgmt_frame(hdr)) && | 758 | if ((!_ieee80211_is_robust_mgmt_frame(hdr)) && |
766 | (ieee80211_has_protected(hdr->frame_control))) | 759 | (ieee80211_has_protected(hdr->frame_control))) |
767 | rx_status->flag |= RX_FLAG_DECRYPTED; | 760 | rx_status->flag |= RX_FLAG_DECRYPTED; |