staging:rtl8192u: Move HTSetConnectBwModeCallback() - Style
authorJohn Whitmore <johnfwhitmore@gmail.com>
Wed, 26 Sep 2018 19:16:55 +0000 (20:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Sep 2018 12:36:58 +0000 (14:36 +0200)
The function HTSetConnectBwModeCallback() is only used in the file
in which it is defined, so has been changed to being of type 'static'.

Additionally the function is defined after it is used so a prototype
was included in the file. This prototype, in the middle of the file
has been removed and the function implementation moved so that it is
defined before it is used in the file.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/ieee80211/ieee80211.h
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c

index 8c91cb29fc9d4691053afabd15ddd9886f18b5df..8aa536d7990002ca16bafa94660e0c376b04b752 100644 (file)
@@ -2379,7 +2379,6 @@ u8 HTGetHighestMCSRate(struct ieee80211_device *ieee,
 extern u8 MCS_FILTER_ALL[];
 extern u16 MCS_DATA_RATE[2][2][77];
 u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame);
-//extern void HTSetConnectBwModeCallback(unsigned long data);
 void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo);
 bool IsHTHalfNmodeAPs(struct ieee80211_device *ieee);
 u16 TxCountToDataRate(struct ieee80211_device *ieee, u8 nDataRate);
index 977a1e5c9b52e7f1b9b575fae554498ab9a0f3b7..c73a8058cf877a4a4d0b3011a7c2600a24cc6021 100644 (file)
@@ -1011,7 +1011,6 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
        pHTInfo->CurrentOpMode = pPeerHTInfo->OptMode;
 }
 
-void HTSetConnectBwModeCallback(struct ieee80211_device *ieee);
 /*
  *function:  initialize HT info(struct PRT_HIGH_THROUGHPUT)
  *   input:  struct ieee80211_device*  ieee
@@ -1228,6 +1227,29 @@ u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame)
        return false;
 }
 
+static void HTSetConnectBwModeCallback(struct ieee80211_device *ieee)
+{
+       PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
+
+       IEEE80211_DEBUG(IEEE80211_DL_HT, "======>%s()\n", __func__);
+
+       if (pHTInfo->bCurBW40MHz) {
+               if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_UPPER)
+                       ieee->set_chan(ieee->dev, ieee->current_network.channel + 2);
+               else if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_LOWER)
+                       ieee->set_chan(ieee->dev, ieee->current_network.channel - 2);
+               else
+                       ieee->set_chan(ieee->dev, ieee->current_network.channel);
+
+               ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, pHTInfo->CurSTAExtChnlOffset);
+       } else {
+               ieee->set_chan(ieee->dev, ieee->current_network.channel);
+               ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
+       }
+
+       pHTInfo->bSwBwInProgress = false;
+}
+
 /*
  * This function set bandwidth mode in protocol layer.
  */
@@ -1278,26 +1300,3 @@ void HTSetConnectBwMode(struct ieee80211_device *ieee, enum ht_channel_width Ban
 
 //     spin_unlock_irqrestore(&(ieee->bw_spinlock), flags);
 }
-
-void HTSetConnectBwModeCallback(struct ieee80211_device *ieee)
-{
-       PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
-
-       IEEE80211_DEBUG(IEEE80211_DL_HT, "======>%s()\n", __func__);
-
-       if (pHTInfo->bCurBW40MHz) {
-               if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_UPPER)
-                       ieee->set_chan(ieee->dev, ieee->current_network.channel + 2);
-               else if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_LOWER)
-                       ieee->set_chan(ieee->dev, ieee->current_network.channel - 2);
-               else
-                       ieee->set_chan(ieee->dev, ieee->current_network.channel);
-
-               ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, pHTInfo->CurSTAExtChnlOffset);
-       } else {
-               ieee->set_chan(ieee->dev, ieee->current_network.channel);
-               ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
-       }
-
-       pHTInfo->bSwBwInProgress = false;
-}