rtw88: remove redundant null pointer check on arrays
authorColin Ian King <colin.king@canonical.com>
Fri, 25 Oct 2019 11:30:56 +0000 (12:30 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 31 Oct 2019 08:04:55 +0000 (10:04 +0200)
The checks to see if swing_table->n or swing_table->p are null are
redundant since n and p are arrays and can never be null if
swing_table is non-null.  I believe these are redundant checks
and can be safely removed, especially the checks implies that these
are not arrays which can lead to confusion.

Addresses-Coverity: ("Array compared against 0")
Fixes: c97ee3e0bea2 ("rtw88: add power tracking support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtw88/phy.c

index 4adba44..a3e1e95 100644 (file)
@@ -2059,7 +2059,7 @@ s8 rtw_phy_pwrtrack_get_pwridx(struct rtw_dev *rtwdev,
                return 0;
        }
 
-       if (!swing_table || !swing_table->n || !swing_table->p) {
+       if (!swing_table) {
                rtw_warn(rtwdev, "swing table not configured\n");
                return 0;
        }