diff mbox

[OPW,kernel,1/5] Staging: rtl8192u: fix sparse warnings for static functions

Message ID 1381789492-2860-2-git-send-email-teobaluta@gmail.com
State New, archived
Headers show

Commit Message

Teodora Baluta Oct. 14, 2013, 10:24 p.m. UTC
Fix sparse warnings for functions that should be static in driver rtl8192u

Signed-off-by: Teodora Baluta <teobaluta@gmail.com>
---
 .../staging/rtl8192u/ieee80211/ieee80211_module.c  |    2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c  |    2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c  |   15 ++--
 .../staging/rtl8192u/ieee80211/rtl819x_BAProc.c    |    6 +-
 drivers/staging/rtl8192u/r8192U_core.c             |   72 +++++++++++---------
 drivers/staging/rtl8192u/r819xU_firmware.c         |    2 +-
 6 files changed, 56 insertions(+), 43 deletions(-)

Comments

gregkh@linuxfoundation.org Oct. 15, 2013, 3:47 p.m. UTC | #1
On Tue, Oct 15, 2013 at 01:24:48AM +0300, Teodora Baluta wrote:
> Fix sparse warnings for functions that should be static in driver rtl8192u
> 
> Signed-off-by: Teodora Baluta <teobaluta@gmail.com>

When I apply this patch, it adds a bunch of build warnings:

drivers/staging/rtl8192u/r8192U_core.c:595:13: warning: ‘rtl8192_proc_module_remove’ defined but not used [-Wunused-function]
drivers/staging/rtl8192u/r8192U_core.c:685:13: warning: ‘dump_eprom’ defined but not used [-Wunused-function]
drivers/staging/rtl8192u/r8192U_core.c:698:13: warning: ‘rtl8192_set_mode’ defined but not used [-Wunused-function]
drivers/staging/rtl8192u/r8192U_core.c:907:12: warning: ‘alloc_tx_beacon_desc_ring’ defined but not used [-Wunused-function]
drivers/staging/rtl8192u/r8192U_core.c:1361:13: warning: ‘rtl8192_beacon_stop’ defined but not used [-Wunused-function]
drivers/staging/rtl8192u/r8192U_core.c:1563:13: warning: ‘rtl819xU_cmd_isr’ defined but not used [-Wunused-function]
drivers/staging/rtl8192u/r8192U_core.c:1568:21: warning: ‘txqueue2outpipe’ defined but not used [-Wunused-function]
drivers/staging/rtl8192u/r8192U_core.c:4717:12: warning: ‘GetRxPacketShiftBytes819xUsb’ defined but not used [-Wunused-function]

Which implies that this patch is not the correct thing to be doing here...

Sorry, I can't accept patches that add warnings to the build, can you please
fix it up and resend?

greg k-h
Josh Triplett Oct. 20, 2013, 12:42 p.m. UTC | #2
On Tue, Oct 15, 2013 at 08:47:35AM -0700, Greg KH wrote:
> On Tue, Oct 15, 2013 at 01:24:48AM +0300, Teodora Baluta wrote:
> > Fix sparse warnings for functions that should be static in driver rtl8192u
> > 
> > Signed-off-by: Teodora Baluta <teobaluta@gmail.com>
> 
> When I apply this patch, it adds a bunch of build warnings:
> 
> drivers/staging/rtl8192u/r8192U_core.c:595:13: warning: ‘rtl8192_proc_module_remove’ defined but not used [-Wunused-function]
> drivers/staging/rtl8192u/r8192U_core.c:685:13: warning: ‘dump_eprom’ defined but not used [-Wunused-function]
> drivers/staging/rtl8192u/r8192U_core.c:698:13: warning: ‘rtl8192_set_mode’ defined but not used [-Wunused-function]
> drivers/staging/rtl8192u/r8192U_core.c:907:12: warning: ‘alloc_tx_beacon_desc_ring’ defined but not used [-Wunused-function]
> drivers/staging/rtl8192u/r8192U_core.c:1361:13: warning: ‘rtl8192_beacon_stop’ defined but not used [-Wunused-function]
> drivers/staging/rtl8192u/r8192U_core.c:1563:13: warning: ‘rtl819xU_cmd_isr’ defined but not used [-Wunused-function]
> drivers/staging/rtl8192u/r8192U_core.c:1568:21: warning: ‘txqueue2outpipe’ defined but not used [-Wunused-function]
> drivers/staging/rtl8192u/r8192U_core.c:4717:12: warning: ‘GetRxPacketShiftBytes819xUsb’ defined but not used [-Wunused-function]
> 
> Which implies that this patch is not the correct thing to be doing here...
> 
> Sorry, I can't accept patches that add warnings to the build, can you please
> fix it up and resend?

Note that if you make a function static and gcc then starts complaining
that it's unused, you can then delete it entirely (assuming that it
isn't used in that file conditionally based on CONFIG_* options, and
that the rest of the kernel builds with the function deleted).

- Josh Triplett
Teodora Baluta Oct. 20, 2013, 1:34 p.m. UTC | #3
On Sun, Oct 20, 2013 at 3:42 PM, Josh Triplett <josh@joshtriplett.org> wrote:
> On Tue, Oct 15, 2013 at 08:47:35AM -0700, Greg KH wrote:
>> On Tue, Oct 15, 2013 at 01:24:48AM +0300, Teodora Baluta wrote:
>> > Fix sparse warnings for functions that should be static in driver rtl8192u
>> >
>> > Signed-off-by: Teodora Baluta <teobaluta@gmail.com>
>>
>> When I apply this patch, it adds a bunch of build warnings:
>>
>> drivers/staging/rtl8192u/r8192U_core.c:595:13: warning: ‘rtl8192_proc_module_remove’ defined but not used [-Wunused-function]
>> drivers/staging/rtl8192u/r8192U_core.c:685:13: warning: ‘dump_eprom’ defined but not used [-Wunused-function]
>> drivers/staging/rtl8192u/r8192U_core.c:698:13: warning: ‘rtl8192_set_mode’ defined but not used [-Wunused-function]
>> drivers/staging/rtl8192u/r8192U_core.c:907:12: warning: ‘alloc_tx_beacon_desc_ring’ defined but not used [-Wunused-function]
>> drivers/staging/rtl8192u/r8192U_core.c:1361:13: warning: ‘rtl8192_beacon_stop’ defined but not used [-Wunused-function]
>> drivers/staging/rtl8192u/r8192U_core.c:1563:13: warning: ‘rtl819xU_cmd_isr’ defined but not used [-Wunused-function]
>> drivers/staging/rtl8192u/r8192U_core.c:1568:21: warning: ‘txqueue2outpipe’ defined but not used [-Wunused-function]
>> drivers/staging/rtl8192u/r8192U_core.c:4717:12: warning: ‘GetRxPacketShiftBytes819xUsb’ defined but not used [-Wunused-function]
>>
>> Which implies that this patch is not the correct thing to be doing here...
>>
>> Sorry, I can't accept patches that add warnings to the build, can you please
>> fix it up and resend?
>
> Note that if you make a function static and gcc then starts complaining
> that it's unused, you can then delete it entirely (assuming that it
> isn't used in that file conditionally based on CONFIG_* options, and
> that the rest of the kernel builds with the function deleted).

When I resent the patch series I undid these fixes, because I wasn't
sure what to do with the functions. For example,
rtl8192_proc_module_remove is a function that is not used anywhere
else, it serves more like a pair for the rtl8192_proc_module_init
function, so I thought it is for future development there (no CONFIG_*
option). Or another example, the dump_eprom function is used for
debug, Should these 2 functions be deleted?

Thanks,
Teodora
Josh Triplett Oct. 20, 2013, 2:20 p.m. UTC | #4
On Sun, Oct 20, 2013 at 04:34:02PM +0300, Teodora B?lu?? wrote:
> On Sun, Oct 20, 2013 at 3:42 PM, Josh Triplett <josh@joshtriplett.org> wrote:
> > On Tue, Oct 15, 2013 at 08:47:35AM -0700, Greg KH wrote:
> >> On Tue, Oct 15, 2013 at 01:24:48AM +0300, Teodora Baluta wrote:
> >> > Fix sparse warnings for functions that should be static in driver rtl8192u
> >> >
> >> > Signed-off-by: Teodora Baluta <teobaluta@gmail.com>
> >>
> >> When I apply this patch, it adds a bunch of build warnings:
> >>
> >> drivers/staging/rtl8192u/r8192U_core.c:595:13: warning: ‘rtl8192_proc_module_remove’ defined but not used [-Wunused-function]
> >> drivers/staging/rtl8192u/r8192U_core.c:685:13: warning: ‘dump_eprom’ defined but not used [-Wunused-function]
> >> drivers/staging/rtl8192u/r8192U_core.c:698:13: warning: ‘rtl8192_set_mode’ defined but not used [-Wunused-function]
> >> drivers/staging/rtl8192u/r8192U_core.c:907:12: warning: ‘alloc_tx_beacon_desc_ring’ defined but not used [-Wunused-function]
> >> drivers/staging/rtl8192u/r8192U_core.c:1361:13: warning: ‘rtl8192_beacon_stop’ defined but not used [-Wunused-function]
> >> drivers/staging/rtl8192u/r8192U_core.c:1563:13: warning: ‘rtl819xU_cmd_isr’ defined but not used [-Wunused-function]
> >> drivers/staging/rtl8192u/r8192U_core.c:1568:21: warning: ‘txqueue2outpipe’ defined but not used [-Wunused-function]
> >> drivers/staging/rtl8192u/r8192U_core.c:4717:12: warning: ‘GetRxPacketShiftBytes819xUsb’ defined but not used [-Wunused-function]
> >>
> >> Which implies that this patch is not the correct thing to be doing here...
> >>
> >> Sorry, I can't accept patches that add warnings to the build, can you please
> >> fix it up and resend?
> >
> > Note that if you make a function static and gcc then starts complaining
> > that it's unused, you can then delete it entirely (assuming that it
> > isn't used in that file conditionally based on CONFIG_* options, and
> > that the rest of the kernel builds with the function deleted).
> 
> When I resent the patch series I undid these fixes, because I wasn't
> sure what to do with the functions. For example,
> rtl8192_proc_module_remove is a function that is not used anywhere
> else, it serves more like a pair for the rtl8192_proc_module_init
> function, so I thought it is for future development there (no CONFIG_*
> option). Or another example, the dump_eprom function is used for
> debug, Should these 2 functions be deleted?

In general, the kernel shouldn't contain unused code, even "for future
development".  If a function exists solely for debug, it should be
#ifdef'd out with a comment (and ideally use some actual kernel config
to enable thedebug), and if it exists for future development it should
live in someone's separate git branch.

So, if you find a completely unused function, rip it out.

- Josh Triplett
diff mbox

Patch

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
index 434c431..4b036a8 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
@@ -241,7 +241,7 @@  static int debug = \
 			    //IEEE80211_DL_DATA	|
 			    IEEE80211_DL_ERR	  //awayls open this flags to show error out
 			    ;
-struct proc_dir_entry *ieee80211_proc;
+static struct proc_dir_entry *ieee80211_proc;
 
 static int show_debug_level(struct seq_file *m, void *v)
 {
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 59900bf..4414c7d 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -2166,7 +2166,7 @@  static inline u8 ieee80211_SignalStrengthTranslate(
 	return RetSS;
 }
 
-long ieee80211_translate_todbm(u8 signal_strength_index	)// 0-100 index.
+static long ieee80211_translate_todbm(u8 signal_strength_index)// 0-100 index.
 {
 	long	signal_power; // in dBm.
 
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
index a7bcc64f..6fde3a9 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
@@ -303,7 +303,8 @@  ieee80211_classify(struct sk_buff *skb, struct ieee80211_network *network)
 }
 
 #define SN_LESS(a, b)		(((a-b)&0x800)!=0)
-void ieee80211_tx_query_agg_cap(struct ieee80211_device *ieee, struct sk_buff *skb, cb_desc *tcb_desc)
+static void ieee80211_tx_query_agg_cap(struct ieee80211_device *ieee,
+				       struct sk_buff *skb, cb_desc *tcb_desc)
 {
 	PRT_HIGH_THROUGHPUT	pHTInfo = ieee->pHTInfo;
 	PTX_TS_RECORD			pTxTs = NULL;
@@ -412,7 +413,8 @@  ieee80211_query_HTCapShortGI(struct ieee80211_device *ieee, cb_desc *tcb_desc)
 		tcb_desc->bUseShortGI = true;
 }
 
-void ieee80211_query_BandwidthMode(struct ieee80211_device *ieee, cb_desc *tcb_desc)
+static void ieee80211_query_BandwidthMode(struct ieee80211_device *ieee,
+					  cb_desc *tcb_desc)
 {
 	PRT_HIGH_THROUGHPUT	pHTInfo = ieee->pHTInfo;
 
@@ -432,7 +434,8 @@  void ieee80211_query_BandwidthMode(struct ieee80211_device *ieee, cb_desc *tcb_d
 	return;
 }
 
-void ieee80211_query_protectionmode(struct ieee80211_device *ieee, cb_desc *tcb_desc, struct sk_buff *skb)
+static void ieee80211_query_protectionmode(struct ieee80211_device *ieee,
+					   cb_desc *tcb_desc, struct sk_buff *skb)
 {
 	// Common Settings
 	tcb_desc->bRTSSTBC			= false;
@@ -543,7 +546,8 @@  NO_PROTECTION:
 }
 
 
-void ieee80211_txrate_selectmode(struct ieee80211_device *ieee, cb_desc *tcb_desc)
+static void ieee80211_txrate_selectmode(struct ieee80211_device *ieee,
+					cb_desc *tcb_desc)
 {
 #ifdef TO_DO_LIST
 	if(!IsDataFrame(pFrame))
@@ -573,7 +577,8 @@  void ieee80211_txrate_selectmode(struct ieee80211_device *ieee, cb_desc *tcb_des
 	}
 }
 
-void ieee80211_query_seqnum(struct ieee80211_device *ieee, struct sk_buff *skb, u8 *dst)
+static void ieee80211_query_seqnum(struct ieee80211_device *ieee,
+				   struct sk_buff *skb, u8 *dst)
 {
 	if (is_multicast_ether_addr(dst))
 		return;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
index db0db93..3684da3 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
@@ -251,7 +251,8 @@  static struct sk_buff *ieee80211_DELBA(
  *  output:  none
  *  notice: If any possible, please hide pBA in ieee. And temporarily use Manage Queue as softmac_mgmt_xmit() usually does
 ********************************************************************************************************************/
-void ieee80211_send_ADDBAReq(struct ieee80211_device *ieee, u8 *dst, PBA_RECORD	pBA)
+static void ieee80211_send_ADDBAReq(struct ieee80211_device *ieee,
+				    u8 *dst, PBA_RECORD pBA)
 {
 	struct sk_buff *skb = NULL;
 	skb = ieee80211_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ); //construct ACT_ADDBAREQ frames so set statuscode zero.
@@ -278,7 +279,8 @@  void ieee80211_send_ADDBAReq(struct ieee80211_device *ieee, u8 *dst, PBA_RECORD
  *  output:  none
  *  notice: If any possible, please hide pBA in ieee. And temporarily use Manage Queue as softmac_mgmt_xmit() usually does
 ********************************************************************************************************************/
-void ieee80211_send_ADDBARsp(struct ieee80211_device *ieee, u8 *dst, PBA_RECORD pBA, u16 StatusCode)
+static void ieee80211_send_ADDBARsp(struct ieee80211_device *ieee, u8 *dst,
+				    PBA_RECORD pBA, u16 StatusCode)
 {
 	struct sk_buff *skb = NULL;
 	skb = ieee80211_ADDBA(ieee, dst, pBA, StatusCode, ACT_ADDBARSP); //construct ACT_ADDBARSP frames
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index cd0946d..295a4b8 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -392,7 +392,7 @@  int read_nic_word(struct net_device *dev, int indx, u16 *data)
 	return 0;
 }
 
-int read_nic_word_E(struct net_device *dev, int indx, u16 *data)
+static int read_nic_word_E(struct net_device *dev, int indx, u16 *data)
 {
 	int status;
 	struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
@@ -585,14 +585,14 @@  static int proc_get_stats_rx(struct seq_file *m, void *v)
 	return 0;
 }
 
-void rtl8192_proc_module_init(void)
+static void rtl8192_proc_module_init(void)
 {
 	RT_TRACE(COMP_INIT, "Initializing proc filesystem");
 	rtl8192_proc = proc_mkdir(RTL819xU_MODULE_NAME, init_net.proc_net);
 }
 
 
-void rtl8192_proc_module_remove(void)
+static void rtl8192_proc_module_remove(void)
 {
 	remove_proc_entry(RTL819xU_MODULE_NAME, init_net.proc_net);
 }
@@ -631,7 +631,7 @@  static const struct rtl8192_proc_file rtl8192_proc_files[] = {
 	{ "" }
 };
 
-void rtl8192_proc_init_one(struct net_device *dev)
+static void rtl8192_proc_init_one(struct net_device *dev)
 {
 	const struct rtl8192_proc_file *f;
 	struct proc_dir_entry *dir;
@@ -656,7 +656,7 @@  void rtl8192_proc_init_one(struct net_device *dev)
 	}
 }
 
-void rtl8192_proc_remove_one(struct net_device *dev)
+static void rtl8192_proc_remove_one(struct net_device *dev)
 {
 	remove_proc_subtree(dev->name, rtl8192_proc);
 }
@@ -682,7 +682,7 @@  void tx_timeout(struct net_device *dev)
 
 
 /* this is only for debug */
-void dump_eprom(struct net_device *dev)
+static void dump_eprom(struct net_device *dev)
 {
 	int i;
 	for (i = 0; i < 63; i++)
@@ -695,7 +695,7 @@  void dump_eprom(struct net_device *dev)
 *****************************************************************************/
 
 
-void rtl8192_set_mode(struct net_device *dev, int mode)
+static void rtl8192_set_mode(struct net_device *dev, int mode)
 {
 	u8 ecmd;
 	read_nic_byte(dev, EPROM_CMD, &ecmd);
@@ -755,7 +755,7 @@  void rtl8192_set_chan(struct net_device *dev, short ch)
 
 static void rtl8192_rx_isr(struct urb *urb);
 
-u32 get_rxpacket_shiftbytes_819xusb(struct ieee80211_rx_stats *pstats)
+static u32 get_rxpacket_shiftbytes_819xusb(struct ieee80211_rx_stats *pstats)
 {
 
 #ifdef USB_RX_AGGREGATION_SUPPORT
@@ -904,7 +904,7 @@  void rtl8192_rtx_disable(struct net_device *dev)
 }
 
 
-int alloc_tx_beacon_desc_ring(struct net_device *dev, int count)
+static int alloc_tx_beacon_desc_ring(struct net_device *dev, int count)
 {
 	return 0;
 }
@@ -1358,7 +1358,7 @@  static void rtl8192_tx_isr(struct urb *tx_urb)
 
 }
 
-void rtl8192_beacon_stop(struct net_device *dev)
+static void rtl8192_beacon_stop(struct net_device *dev)
 {
 	u8 msr, msrm, msr2;
 	struct r8192_priv *priv = ieee80211_priv(dev);
@@ -1560,12 +1560,13 @@  u16 N_DBPSOfRate(u16 DataRate)
 	return N_DBPS;
 }
 
-void rtl819xU_cmd_isr(struct urb *tx_cmd_urb, struct pt_regs *regs)
+static void rtl819xU_cmd_isr(struct urb *tx_cmd_urb, struct pt_regs *regs)
 {
 	usb_free_urb(tx_cmd_urb);
 }
 
-unsigned int txqueue2outpipe(struct r8192_priv *priv, unsigned int tx_queue)
+static unsigned int txqueue2outpipe(struct r8192_priv *priv,
+				    unsigned int tx_queue)
 {
 	if (tx_queue >= 9) {
 		RT_TRACE(COMP_ERR, "%s():Unknown queue ID!!!\n", __func__);
@@ -1636,7 +1637,7 @@  short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb)
  *
  * \param QUEUEID       Software Queue
 */
-u8 MapHwQueueToFirmwareQueue(u8 QueueID)
+static u8 MapHwQueueToFirmwareQueue(u8 QueueID)
 {
 	u8 QueueSelect = 0x0;       //defualt set to
 
@@ -1723,7 +1724,7 @@  u8 MRateToHwRate8190Pci(u8 rate)
 }
 
 
-u8 QueryIsShort(u8 TxHT, u8 TxRate, cb_desc *tcb_desc)
+static u8 QueryIsShort(u8 TxHT, u8 TxRate, cb_desc *tcb_desc)
 {
 	u8   tmp_Short;
 
@@ -1934,7 +1935,7 @@  short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	}
 }
 
-short rtl8192_usb_initendpoints(struct net_device *dev)
+static short rtl8192_usb_initendpoints(struct net_device *dev)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
 
@@ -1992,7 +1993,7 @@  short rtl8192_usb_initendpoints(struct net_device *dev)
 
 }
 #ifdef THOMAS_BEACON
-void rtl8192_usb_deleteendpoints(struct net_device *dev)
+static void rtl8192_usb_deleteendpoints(struct net_device *dev)
 {
 	int i;
 	struct r8192_priv *priv = ieee80211_priv(dev);
@@ -2292,7 +2293,7 @@  void rtl8192_update_ratr_table(struct net_device *dev)
 
 static u8 ccmp_ie[4] = {0x00, 0x50, 0xf2, 0x04};
 static u8 ccmp_rsn_ie[4] = {0x00, 0x0f, 0xac, 0x04};
-bool GetNmodeSupportBySecCfg8192(struct net_device *dev)
+static bool GetNmodeSupportBySecCfg8192(struct net_device *dev)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
 	struct ieee80211_device *ieee = priv->ieee80211;
@@ -3167,7 +3168,7 @@  static struct net_device_stats *rtl8192_stats(struct net_device *dev)
 	return &priv->ieee80211->stats;
 }
 
-bool HalTxCheckStuck819xUsb(struct net_device *dev)
+static bool HalTxCheckStuck819xUsb(struct net_device *dev)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
 	u16		RegTxCounter;
@@ -3217,7 +3218,7 @@  RESET_TYPE TxCheckStuck(struct net_device *dev)
 	return RESET_TYPE_NORESET;
 }
 
-bool HalRxCheckStuck819xUsb(struct net_device *dev)
+static bool HalRxCheckStuck819xUsb(struct net_device *dev)
 {
 	u16	RegRxCounter;
 	struct r8192_priv *priv = ieee80211_priv(dev);
@@ -3259,7 +3260,7 @@  bool HalRxCheckStuck819xUsb(struct net_device *dev)
 	return bStuck;
 }
 
-RESET_TYPE RxCheckStuck(struct net_device *dev)
+static RESET_TYPE RxCheckStuck(struct net_device *dev)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
 	bool        bRxCheck = FALSE;
@@ -3952,7 +3953,8 @@  u8 HwRateToMRate90(bool bIsHT, u8 rate)
  * Return:
  *               None
  */
-void UpdateRxPktTimeStamp8190(struct net_device *dev, struct ieee80211_rx_stats *stats)
+static void UpdateRxPktTimeStamp8190(struct net_device *dev,
+				     struct ieee80211_rx_stats *stats)
 {
 	struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
 
@@ -4209,7 +4211,7 @@  static u8 rtl819x_evm_dbtopercentage(char value)
 //	We want good-looking for signal strength/quality
 //	2007/7/19 01:09, by cosa.
 //
-long rtl819x_signal_scale_mapping(long currsig)
+static long rtl819x_signal_scale_mapping(long currsig)
 {
 	long retsig;
 
@@ -4478,9 +4480,9 @@  void rtl8192_record_rxdesc_forlateruse(struct ieee80211_rx_stats *psrc_stats,
 }
 
 
-void TranslateRxSignalStuff819xUsb(struct sk_buff *skb,
-				   struct ieee80211_rx_stats *pstats,
-				   rx_drvinfo_819x_usb  *pdrvinfo)
+static void TranslateRxSignalStuff819xUsb(struct sk_buff *skb,
+					  struct ieee80211_rx_stats *pstats,
+					  rx_drvinfo_819x_usb  *pdrvinfo)
 {
 	// TODO: We must only check packet for current MAC address. Not finish
 	rtl8192_rx_info *info = (struct rtl8192_rx_info *)skb->cb;
@@ -4549,8 +4551,8 @@  void TranslateRxSignalStuff819xUsb(struct sk_buff *skb,
 * Return:
 *		None
 */
-void UpdateReceivedRateHistogramStatistics8190(struct net_device *dev,
-					       struct ieee80211_rx_stats *stats)
+static void UpdateReceivedRateHistogramStatistics8190(struct net_device *dev,
+						      struct ieee80211_rx_stats *stats)
 {
 	struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
 	u32 rcvType = 1;   //0: Total, 1:OK, 2:CRC, 3:ICV
@@ -4614,7 +4616,9 @@  void UpdateReceivedRateHistogramStatistics8190(struct net_device *dev,
 }
 
 
-void query_rxdesc_status(struct sk_buff *skb, struct ieee80211_rx_stats *stats, bool bIsRxAggrSubframe)
+static void query_rxdesc_status(struct sk_buff *skb,
+				struct ieee80211_rx_stats *stats,
+				bool bIsRxAggrSubframe)
 {
 	rtl8192_rx_info *info = (struct rtl8192_rx_info *)skb->cb;
 	struct net_device *dev = info->dev;
@@ -4726,7 +4730,8 @@  void query_rxdesc_status(struct sk_buff *skb, struct ieee80211_rx_stats *stats,
 
 }
 
-u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status, bool bIsRxAggrSubframe)
+static u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status,
+					bool bIsRxAggrSubframe)
 {
 #ifdef USB_RX_AGGREGATION_SUPPORT
 	if (bIsRxAggrSubframe)
@@ -4738,7 +4743,7 @@  u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status, bool bIsRxA
 			+ Status->RxBufShift);
 }
 
-void rtl8192_rx_nomal(struct sk_buff *skb)
+static void rtl8192_rx_nomal(struct sk_buff *skb)
 {
 	rtl8192_rx_info *info = (struct rtl8192_rx_info *)skb->cb;
 	struct net_device *dev = info->dev;
@@ -4888,8 +4893,8 @@  void rtl8192_rx_nomal(struct sk_buff *skb)
 
 }
 
-void rtl819xusb_process_received_packet(struct net_device *dev,
-					struct ieee80211_rx_stats *pstats)
+static void rtl819xusb_process_received_packet(struct net_device *dev,
+					       struct ieee80211_rx_stats *pstats)
 {
 	u8	*frame;
 	u16     frame_len = 0;
@@ -4930,7 +4935,8 @@  void rtl819xusb_process_received_packet(struct net_device *dev,
 
 }
 
-void query_rx_cmdpkt_desc_status(struct sk_buff *skb, struct ieee80211_rx_stats *stats)
+static void query_rx_cmdpkt_desc_status(struct sk_buff *skb,
+					struct ieee80211_rx_stats *stats)
 {
 	rx_desc_819x_usb *desc = (rx_desc_819x_usb *)skb->data;
 
diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c
index bb924ac..ebdea58 100644
--- a/drivers/staging/rtl8192u/r819xU_firmware.c
+++ b/drivers/staging/rtl8192u/r819xU_firmware.c
@@ -107,7 +107,7 @@  bool fw_download_code(struct net_device *dev, u8 *code_virtual_address, u32 buff
 
 }
 
-bool
+static bool
 fwSendNullPacket(
 	struct net_device *dev,
 	u32			Length