linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Whitmore <johnfwhitmore@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
	John Whitmore <johnfwhitmore@gmail.com>
Subject: [PATCH 04/13] staging:rtl8192u: Move HTSetConnectBwModeCallback() - Style
Date: Wed, 26 Sep 2018 20:16:55 +0100	[thread overview]
Message-ID: <20180926191704.16322-5-johnfwhitmore@gmail.com> (raw)
In-Reply-To: <20180926191704.16322-1-johnfwhitmore@gmail.com>

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>
---
 .../staging/rtl8192u/ieee80211/ieee80211.h    |  1 -
 .../rtl8192u/ieee80211/rtl819x_HTProc.c       | 47 +++++++++----------
 2 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index 8c91cb29fc9d..8aa536d79900 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -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);
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 977a1e5c9b52..c73a8058cf87 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -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;
-}
-- 
2.18.0


  parent reply	other threads:[~2018-09-26 19:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 19:16 [PATCH 00/13] staging:rtl8192u: Style & memory leak fix John Whitmore
2018-09-26 19:16 ` [PATCH 01/13] staging:rtl8192u: Remove HTHalfMcsToDataRate() - Style John Whitmore
2018-09-26 19:16 ` [PATCH 02/13] staging:rtl8192u: Make HTMcsToDataRate static " John Whitmore
2018-09-26 19:16 ` [PATCH 03/13] staging:rtl8192u: Remove definition of HTSetConnectBwMode " John Whitmore
2018-09-26 19:16 ` John Whitmore [this message]
2018-09-26 19:16 ` [PATCH 05/13] staging:rtl8192u: Remove AdvCoding and GreenField " John Whitmore
2018-09-28 12:35   ` Greg KH
2018-09-28 22:38     ` John Whitmore
2018-09-28 14:31   ` Dan Carpenter
2018-09-28 22:32     ` John Whitmore
2018-09-26 19:16 ` [PATCH 06/13] staging:rtl8192u: Remove TxSTBC and RxSTBC " John Whitmore
2018-09-28 12:36   ` Greg KH
2018-09-28 14:32   ` Dan Carpenter
2018-09-26 19:16 ` [PATCH 07/13] staging:rtl8192u: Remove DelayBA, PSMP and Rsvd1 " John Whitmore
2018-09-28 14:33   ` Dan Carpenter
2018-09-26 19:16 ` [PATCH 08/13] staging:rtl8192u: Remove LSigTxopProtect " John Whitmore
2018-09-26 19:17 ` [PATCH 09/13] staging:rtl8192u: Remove Rsvd2 " John Whitmore
2018-09-26 19:17 ` [PATCH 10/13] staging:rtl8192u: Remove ExtHTCapInfo " John Whitmore
2018-09-26 19:17 ` [PATCH 11/13] staging:rtl8192u: Remove TxBFCap " John Whitmore
2018-09-26 19:17 ` [PATCH 12/13] staging:rtl8192u: Remove ASCap " John Whitmore
2018-09-26 19:17 ` [PATCH 13/13] staging:rtl8192u: Remove potential memory leak John Whitmore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180926191704.16322-5-johnfwhitmore@gmail.com \
    --to=johnfwhitmore@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).