staging: wfx: do not declare variables inside loops
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Tue, 26 May 2020 17:18:13 +0000 (19:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 May 2020 08:18:08 +0000 (10:18 +0200)
The local variables should be declared at beginning of the functions.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200526171821.934581-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/data_tx.c

index a9eddd6db2b5d03f936d1c2cf33455b6b52175a7..f042ef36b408e6071b357f110389caee3601d67c 100644 (file)
@@ -42,15 +42,13 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev,
 static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy,
                                struct ieee80211_tx_rate *rates)
 {
-       int i;
        struct wfx_dev *wdev = wvif->wdev;
+       int i, rateid;
+       u8 count;
 
        WARN(rates[0].idx < 0, "invalid rate policy");
        memset(policy, 0, sizeof(*policy));
        for (i = 0; i < IEEE80211_TX_MAX_RATES; ++i) {
-               int rateid;
-               u8 count;
-
                if (rates[i].idx < 0)
                        break;
                WARN_ON(rates[i].count > 15);