wireless: carl9170: fix clang build warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 25 Mar 2019 12:43:44 +0000 (13:43 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 29 Apr 2019 15:00:42 +0000 (18:00 +0300)
clang fails to eliminate some dead code with always-taken branches
when CONFIG_PROFILE_ANNOTATED_BRANCHES is set, leading to a false-positive
warning:

drivers/net/wireless/ath/carl9170/mac.c:522:3: error: variable 'power' is used uninitialized whenever 'if' condition is
      false [-Werror,-Wsometimes-uninitialized]
                BUG_ON(1);
                ^~~~~~~~~

Change both instances of BUG_ON(1) in carl9170 to the simpler BUG()
to avoid the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/carl9170/mac.c
drivers/net/wireless/ath/carl9170/rx.c

index 7d4a72dc98dba2de94f22b3f805fffda7045966c..b2eeb9fd68d2a7df661e522511814fe268f43a34 100644 (file)
@@ -519,7 +519,7 @@ int carl9170_set_mac_tpc(struct ar9170 *ar, struct ieee80211_channel *channel)
                power = ar->power_5G_leg[0] & 0x3f;
                break;
        default:
-               BUG_ON(1);
+               BUG();
        }
 
        power = min_t(unsigned int, power, ar->hw->conf.power_level * 2);
index 8e154f6364a38081c5db587895b1f2bc76bd69a9..23ab8a80c18ceb03d7b4afdd0b36cda10850945b 100644 (file)
@@ -795,7 +795,7 @@ static void carl9170_rx_untie_data(struct ar9170 *ar, u8 *buf, int len)
                break;
 
        default:
-               BUG_ON(1);
+               BUG();
                break;
        }