staging: rtl8192e: Fix sparse (non-endian) warnings - Part II

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
diff --git a/drivers/staging/rtl8192e/r8192E_cmdpkt.c b/drivers/staging/rtl8192e/r8192E_cmdpkt.c
index 881eb1f..09978b6 100644
--- a/drivers/staging/rtl8192e/r8192E_cmdpkt.c
+++ b/drivers/staging/rtl8192e/r8192E_cmdpkt.c
@@ -34,7 +34,7 @@
 }
 
 /*---------------------------Define functions---------------------------------*/
-extern	bool cmpk_message_handle_tx(
+bool cmpk_message_handle_tx(
 	struct net_device *dev,
 	u8	*code_virtual_address,
 	u32	packettype,
@@ -167,7 +167,7 @@
 
 }	/* cmpk_Handle_Tx_Feedback */
 
-void cmdpkt_beacontimerinterrupt_819xusb(struct net_device *dev)
+static void cmdpkt_beacontimerinterrupt_819xusb(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u16 tx_rate;
@@ -339,10 +339,8 @@
 }
 
 
-extern	u32
-cmpk_message_handle_rx(
-	struct net_device *dev,
-	struct rtllib_rx_stats *pstats)
+u32 cmpk_message_handle_rx(struct net_device *dev,
+			   struct rtllib_rx_stats *pstats)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	int			total_length;
diff --git a/drivers/staging/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/r8192E_dev.c
index 229d6df..899e4e5 100644
--- a/drivers/staging/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/r8192E_dev.c
@@ -57,7 +57,7 @@
 	rtl8192_irq_enable(dev);
 }
 
-void rtl8192e_update_msr(struct net_device *dev)
+static void rtl8192e_update_msr(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u8 msr;
@@ -952,7 +952,7 @@
 	return rtStatus;
 }
 
-void rtl8192_net_update(struct net_device *dev)
+static void rtl8192_net_update(struct net_device *dev)
 {
 
 	struct r8192_priv *priv = rtllib_priv(dev);
@@ -1127,7 +1127,7 @@
 	return ret;
 }
 
-u8 rtl8192_MapHwQueueToFirmwareQueue(u8 QueueID, u8 priority)
+static u8 rtl8192_MapHwQueueToFirmwareQueue(u8 QueueID, u8 priority)
 {
 	u8 QueueSelect = 0x0;
 
@@ -1301,7 +1301,7 @@
 	entry->OWN = 1;
 }
 
-u8 HwRateToMRate90(bool bIsHT, u8 rate)
+static u8 HwRateToMRate90(bool bIsHT, u8 rate)
 {
 	u8  ret_rate = 0x02;
 
@@ -1414,7 +1414,7 @@
 	return ret_rate;
 }
 
-long rtl8192_signal_scale_mapping(struct r8192_priv *priv, long currsig)
+static long rtl8192_signal_scale_mapping(struct r8192_priv *priv, long currsig)
 {
 	long retsig;
 
@@ -1450,7 +1450,7 @@
 			_pdrvinfo->RxRate == DESC90_RATE11M) &&\
 			!_pdrvinfo->RxHT)
 
-void rtl8192_query_rxphystatus(
+static void rtl8192_query_rxphystatus(
 	struct r8192_priv *priv,
 	struct rtllib_rx_stats *pstats,
 	struct rx_desc  *pdesc,
@@ -1664,9 +1664,9 @@
 	}
 }
 
-void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
-			     struct rtllib_rx_stats *prev_st,
-			     struct rtllib_rx_stats *curr_st)
+static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
+				    struct rtllib_rx_stats *prev_st,
+				    struct rtllib_rx_stats *curr_st)
 {
 	bool bcheck = false;
 	u8	rfpath;
@@ -1839,10 +1839,11 @@
 	}
 }
 
-void rtl8192_TranslateRxSignalStuff(struct net_device *dev, struct sk_buff *skb,
-					struct rtllib_rx_stats *pstats,
-					struct rx_desc *pdesc,
-					struct rx_fwinfo *pdrvinfo)
+static void rtl8192_TranslateRxSignalStuff(struct net_device *dev,
+					   struct sk_buff *skb,
+					   struct rtllib_rx_stats *pstats,
+					   struct rx_desc *pdesc,
+					   struct rx_fwinfo *pdrvinfo)
 {
 	struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
 	bool bpacket_match_bssid, bpacket_toself;
@@ -1867,7 +1868,7 @@
 			   (fc & RTLLIB_FCTL_TODS) ? hdr->addr1 :
 			   (fc & RTLLIB_FCTL_FROMDS) ? hdr->addr2 : hdr->addr3))
 		&& (!pstats->bHwError) && (!pstats->bCRC) && (!pstats->bICV));
-	bpacket_toself =  bpacket_match_bssid &
+	bpacket_toself =  bpacket_match_bssid &&	/* check this */
 			  (!compare_ether_addr(praddr,
 			  priv->rtllib->dev->dev_addr));
 	if (WLAN_FC_GET_FRAMETYPE(fc) == RTLLIB_STYPE_BEACON)
@@ -1883,7 +1884,8 @@
 	rtl8192_record_rxdesc_forlateruse(pstats, &previous_stats);
 }
 
-void rtl8192_UpdateReceivedRateHistogramStatistics(struct net_device *dev,
+static void rtl8192_UpdateReceivedRateHistogramStatistics(
+					   struct net_device *dev,
 					   struct rtllib_rx_stats *pstats)
 {
 	struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
@@ -2255,17 +2257,6 @@
 }
 
 
-void rtl8192_beacon_disable(struct net_device *dev)
-{
-	struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
-	u32 reg;
-
-	reg = read_nic_dword(priv->rtllib->dev, INTA_MASK);
-
-	reg &= ~(IMR_BcnInt | IMR_BcnInt | IMR_TBDOK | IMR_TBDER);
-	write_nic_dword(priv->rtllib->dev, INTA_MASK, reg);
-}
-
 void rtl8192_interrupt_recognized(struct net_device *dev, u32 *p_inta,
 				  u32 *p_intb)
 {
diff --git a/drivers/staging/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/r8192E_firmware.c
index c268999..3771985 100644
--- a/drivers/staging/rtl8192e/r8192E_firmware.c
+++ b/drivers/staging/rtl8192e/r8192E_firmware.c
@@ -23,7 +23,7 @@
 #include "r8192E_firmware.h"
 #include <linux/firmware.h>
 
-extern void firmware_init_param(struct net_device *dev)
+void firmware_init_param(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	struct rt_firmware *pfirmware = priv->pFirmware;
@@ -32,8 +32,8 @@
 					     MAX_TRANSMIT_BUFFER_SIZE);
 }
 
-bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
-		      u32 buffer_len)
+static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
+			     u32 buffer_len)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	bool		    rt_status = true;
@@ -102,42 +102,7 @@
 	return rt_status;
 }
 
-bool fwSendNullPacket(struct net_device *dev, u32 Length)
-{
-	bool	rtStatus = true;
-	struct r8192_priv *priv = rtllib_priv(dev);
-	struct sk_buff	    *skb;
-	struct cb_desc *tcb_desc;
-	unsigned char	    *ptr_buf;
-	bool	bLastInitPacket = false;
-
-
-	skb  = dev_alloc_skb(Length + 4);
-	memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
-	tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
-	tcb_desc->queue_index = TXCMD_QUEUE;
-	tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT;
-	tcb_desc->bLastIniPkt = bLastInitPacket;
-	ptr_buf = skb_put(skb, Length);
-	memset(ptr_buf, 0, Length);
-	tcb_desc->txbuf_size = (u16)Length;
-
-	if (!priv->rtllib->check_nic_enough_desc(dev, tcb_desc->queue_index) ||
-	    (!skb_queue_empty(&priv->rtllib->skb_waitQ[tcb_desc->
-	    queue_index])) || (priv->rtllib->queue_stop)) {
-		RT_TRACE(COMP_FIRMWARE, "===================NULL packet========"
-			 "========> tx full!\n");
-		skb_queue_tail(&priv->rtllib->skb_waitQ[tcb_desc->queue_index],
-			       skb);
-	} else {
-		priv->rtllib->softmac_hard_start_xmit(skb, dev);
-	}
-
-	write_nic_byte(dev, TPPoll, TPPoll_CQ);
-	return rtStatus;
-}
-
-bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
+static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
 {
 	bool		rt_status = true;
 	u32		CPU_status = 0;
@@ -184,7 +149,7 @@
 	return rt_status;
 }
 
-bool CPUcheck_firmware_ready(struct net_device *dev)
+static bool CPUcheck_firmware_ready(struct net_device *dev)
 {
 
 	bool	rt_status = true;
diff --git a/drivers/staging/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/r8192E_phy.c
index 96ccbd5..83e00d7 100644
--- a/drivers/staging/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/r8192E_phy.c
@@ -53,7 +53,8 @@
 static void phy_FwRFSerialWrite(struct net_device *dev,
 				enum rf90_radio_path eRFPath,
 				u32 Offset, u32 Data);
-u32 rtl8192_CalculateBitShift(u32 dwBitMask)
+
+static u32 rtl8192_CalculateBitShift(u32 dwBitMask)
 {
 	u32 i;
 	for (i = 0; i <= 31; i++) {
@@ -105,8 +106,8 @@
 
 	return Ret;
 }
-u32 rtl8192_phy_RFSerialRead(struct net_device *dev,
-			     enum rf90_radio_path eRFPath, u32 Offset)
+static u32 rtl8192_phy_RFSerialRead(struct net_device *dev,
+				    enum rf90_radio_path eRFPath, u32 Offset)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u32 ret = 0;
@@ -161,9 +162,9 @@
 
 }
 
-void rtl8192_phy_RFSerialWrite(struct net_device *dev,
-			       enum rf90_radio_path eRFPath, u32 Offset,
-			       u32 Data)
+static void rtl8192_phy_RFSerialWrite(struct net_device *dev,
+				      enum rf90_radio_path eRFPath, u32 Offset,
+				      u32 Data)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u32 DataAndAddr = 0, NewOffset = 0;
@@ -400,7 +401,7 @@
 	return;
 }
 
-void rtl8192_InitBBRFRegDef(struct net_device *dev)
+static void rtl8192_InitBBRFRegDef(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 
@@ -549,7 +550,7 @@
 	return ret;
 }
 
-bool rtl8192_BB_Config_ParaFile(struct net_device *dev)
+static bool rtl8192_BB_Config_ParaFile(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	bool rtStatus = true;
@@ -790,7 +791,7 @@
 	return ret;
 
 }
-void rtl8192_SetTxPowerLevel(struct net_device *dev, u8 channel)
+static void rtl8192_SetTxPowerLevel(struct net_device *dev, u8 channel)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u8	powerlevel = priv->TxPowerLevelCCK[channel-1];
@@ -815,9 +816,10 @@
 	return;
 }
 
-u8 rtl8192_phy_SetSwChnlCmdArray(struct sw_chnl_cmd *CmdTable, u32 CmdTableIdx,
-				 u32 CmdTableSz, enum sw_chnl_cmd_id CmdID,
-				 u32 Para1, u32 Para2, u32 msDelay)
+static u8 rtl8192_phy_SetSwChnlCmdArray(struct sw_chnl_cmd *CmdTable,
+					u32 CmdTableIdx, u32 CmdTableSz,
+					enum sw_chnl_cmd_id CmdID,
+					u32 Para1, u32 Para2, u32 msDelay)
 {
 	struct sw_chnl_cmd *pCmd;
 
@@ -843,8 +845,8 @@
 	return true;
 }
 
-u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, u8 *stage,
-				u8 *step, u32 *delay)
+static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,
+				       u8 *stage, u8 *step, u32 *delay)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	struct sw_chnl_cmd PreCommonCmd[MAX_PRECMD_CNT];
@@ -983,7 +985,7 @@
 	return false;
 }
 
-void rtl8192_phy_FinishSwChnlNow(struct net_device *dev, u8 channel)
+static void rtl8192_phy_FinishSwChnlNow(struct net_device *dev, u8 channel)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u32 delay = 0;
@@ -1410,8 +1412,8 @@
 
 }
 
-bool SetRFPowerState8190(struct net_device *dev,
-			 enum rt_rf_power_state eRFPowerState)
+static bool SetRFPowerState8190(struct net_device *dev,
+				enum rt_rf_power_state eRFPowerState)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
@@ -1608,7 +1610,7 @@
 	return bResult;
 }
 
-extern void PHY_ScanOperationBackup8192(struct net_device *dev, u8 Operation)
+void PHY_ScanOperationBackup8192(struct net_device *dev, u8 Operation)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 
diff --git a/drivers/staging/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl_core.c
index 68a4e85..9bc20f0 100644
--- a/drivers/staging/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl_core.c
@@ -58,10 +58,10 @@
 
 int hwwep = 1;
 static int channels = 0x3fff;
-char *ifname = "wlan%d";
+static char *ifname = "wlan%d";
 
 
-struct rtl819x_ops rtl819xp_ops = {
+static struct rtl819x_ops rtl819xp_ops = {
 	.nic_type			= NIC_8192E,
 	.get_eeprom_size		= rtl8192_get_eeprom_size,
 	.init_adapter_variable		= rtl8192_InitializeVariables,
@@ -108,7 +108,7 @@
 /****************************************************************************
    -----------------------------IO STUFF-------------------------
 *****************************************************************************/
-bool PlatformIOCheckPageLegalAndGetRegMask(u32 u4bPage, u8 *pu1bPageMask)
+static bool PlatformIOCheckPageLegalAndGetRegMask(u32 u4bPage, u8 *pu1bPageMask)
 {
 	bool		bReturn = false;
 
@@ -276,36 +276,36 @@
 
 u8 read_nic_byte(struct net_device *dev, int x)
 {
-	return 0xff & readb((u8 *)dev->mem_start + x);
+	return 0xff & readb((u8 __iomem *)dev->mem_start + x);
 }
 
 u32 read_nic_dword(struct net_device *dev, int x)
 {
-	return readl((u8 *)dev->mem_start + x);
+	return readl((u8 __iomem *)dev->mem_start + x);
 }
 
 u16 read_nic_word(struct net_device *dev, int x)
 {
-	return readw((u8 *)dev->mem_start + x);
+	return readw((u8 __iomem *)dev->mem_start + x);
 }
 
 void write_nic_byte(struct net_device *dev, int x, u8 y)
 {
-	writeb(y, (u8 *)dev->mem_start + x);
+	writeb(y, (u8 __iomem *)dev->mem_start + x);
 
 	udelay(20);
 }
 
 void write_nic_dword(struct net_device *dev, int x, u32 y)
 {
-	writel(y, (u8 *)dev->mem_start + x);
+	writel(y, (u8 __iomem *)dev->mem_start + x);
 
 	udelay(20);
 }
 
 void write_nic_word(struct net_device *dev, int x, u16 y)
 {
-	writew(y, (u8 *)dev->mem_start + x);
+	writew(y, (u8 __iomem *)dev->mem_start + x);
 
 	udelay(20);
 }
@@ -452,7 +452,7 @@
 }
 
 
-short rtl8192_get_nic_desc_num(struct net_device *dev, int prio)
+static short rtl8192_get_nic_desc_num(struct net_device *dev, int prio)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	struct rtl8192_tx_ring *ring = &priv->tx_ring[prio];
@@ -467,7 +467,7 @@
 	return skb_queue_len(&ring->queue);
 }
 
-short rtl8192_check_nic_enough_desc(struct net_device *dev, int prio)
+static short rtl8192_check_nic_enough_desc(struct net_device *dev, int prio)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	struct rtl8192_tx_ring *ring = &priv->tx_ring[prio];
@@ -502,14 +502,6 @@
 	priv->irq_enabled = 0;
 }
 
-void rtl8192_irq_clear(struct net_device *dev)
-{
-	struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
-
-	priv->ops->irq_clear(dev);
-}
-
-
 void rtl8192_set_chan(struct net_device *dev, short ch)
 {
 	struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
@@ -579,7 +571,7 @@
 	{0, 0, 0, 0}
 };
 
-void rtl8192_update_beacon(void *data)
+static void rtl8192_update_beacon(void *data)
 {
 	struct r8192_priv *priv = container_of_work_rsl(data, struct r8192_priv,
 				  update_beacon_wq.work);
@@ -598,7 +590,7 @@
 #define MOVE_INTO_HANDLER
 int WDCAPARA_ADD[] = {EDCAPARA_BE, EDCAPARA_BK, EDCAPARA_VI, EDCAPARA_VO};
 
-void rtl8192_qos_activate(void *data)
+static void rtl8192_qos_activate(void *data)
 {
 	struct r8192_priv *priv = container_of_work_rsl(data, struct r8192_priv,
 				  qos_activate);
@@ -758,7 +750,7 @@
 	return 0;
 }
 
-void rtl8192_prepare_beacon(struct r8192_priv *priv)
+static void rtl8192_prepare_beacon(struct r8192_priv *priv)
 {
 	struct net_device *dev = priv->rtllib->dev;
 	struct sk_buff *pskb = NULL, *pnewskb = NULL;
@@ -791,7 +783,7 @@
 	return;
 }
 
-void rtl8192_stop_beacon(struct net_device *dev)
+static void rtl8192_stop_beacon(struct net_device *dev)
 {
 }
 
@@ -887,7 +879,7 @@
 	}
 }
 
-void rtl8192_refresh_supportrate(struct r8192_priv *priv)
+static void rtl8192_refresh_supportrate(struct r8192_priv *priv)
 {
 	struct rtllib_device *ieee = priv->rtllib;
 	if (ieee->mode == WIRELESS_MODE_N_24G ||
@@ -903,7 +895,7 @@
 	return;
 }
 
-u8 rtl8192_getSupportedWireleeMode(struct net_device *dev)
+static u8 rtl8192_getSupportedWireleeMode(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u8 ret = 0;
@@ -973,7 +965,7 @@
 	rtl8192_refresh_supportrate(priv);
 }
 
-int _rtl8192_sta_up(struct net_device *dev, bool is_silent_reset)
+static int _rtl8192_sta_up(struct net_device *dev, bool is_silent_reset)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
@@ -1016,7 +1008,7 @@
 	return 0;
 }
 
-int rtl8192_sta_down(struct net_device *dev, bool shutdownrf)
+static int rtl8192_sta_down(struct net_device *dev, bool shutdownrf)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	unsigned long flags = 0;
@@ -1243,9 +1235,10 @@
 	priv->card_type = PCI;
 
 	priv->AcmControl = 0;
-	priv->pFirmware = vmalloc(sizeof(struct rt_firmware));
-	if (priv->pFirmware)
-		memset(priv->pFirmware, 0, sizeof(struct rt_firmware));
+	priv->pFirmware = vzalloc(sizeof(struct rt_firmware));
+	if (!priv->pFirmware)
+		printk(KERN_ERR "rtl8193e: Unable to allocate space "
+		       "for firmware\n");
 
 	skb_queue_head_init(&priv->rx_queue);
 	skb_queue_head_init(&priv->skb_queue);
@@ -1302,7 +1295,7 @@
 		     (unsigned long)priv);
 }
 
-short rtl8192_get_channel_map(struct net_device *dev)
+static short rtl8192_get_channel_map(struct net_device *dev)
 {
 	int i;
 
@@ -1330,7 +1323,7 @@
 	return 0;
 }
 
-short rtl8192_init(struct net_device *dev)
+static short rtl8192_init(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 
@@ -1395,7 +1388,7 @@
 	return 1;
 }
 
-enum reset_type rtl819x_TxCheckStuck(struct net_device *dev)
+static enum reset_type rtl819x_TxCheckStuck(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u8	QueueID;
@@ -1454,7 +1447,7 @@
 	return RESET_TYPE_NORESET;
 }
 
-enum reset_type rtl819x_RxCheckStuck(struct net_device *dev)
+static enum reset_type rtl819x_RxCheckStuck(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 
@@ -1466,8 +1459,7 @@
 	return RESET_TYPE_NORESET;
 }
 
-enum reset_type
-rtl819x_ifcheck_resetornot(struct net_device *dev)
+static enum reset_type rtl819x_ifcheck_resetornot(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	enum reset_type TxResetType = RESET_TYPE_NORESET;
@@ -1500,11 +1492,11 @@
 
 }
 
-void rtl819x_silentreset_mesh_bk(struct net_device *dev, u8 IsPortal)
+static void rtl819x_silentreset_mesh_bk(struct net_device *dev, u8 IsPortal)
 {
 }
 
-void rtl819x_ifsilentreset(struct net_device *dev)
+static void rtl819x_ifsilentreset(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u8	reset_times = 0;
@@ -1643,8 +1635,8 @@
 	}
 }
 
-void rtl819x_update_rxcounts(struct r8192_priv *priv, u32 *TotalRxBcnNum,
-			     u32 *TotalRxDataNum)
+static void rtl819x_update_rxcounts(struct r8192_priv *priv, u32 *TotalRxBcnNum,
+				    u32 *TotalRxDataNum)
 {
 	u16	SlotIndex;
 	u8	i;
@@ -1975,7 +1967,7 @@
 
 }
 
-void rtl8192_tx_isr(struct net_device *dev, int prio)
+static void rtl8192_tx_isr(struct net_device *dev, int prio)
 {
 	struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
 
@@ -2103,7 +2095,7 @@
 	return 0;
 }
 
-short rtl8192_alloc_rx_desc_ring(struct net_device *dev)
+static short rtl8192_alloc_rx_desc_ring(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	struct rx_desc *entry = NULL;
@@ -2341,7 +2333,7 @@
 
 
 
-void rtl8192_rx_normal(struct net_device *dev)
+static void rtl8192_rx_normal(struct net_device *dev)
 {
 	struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
 	struct rtllib_hdr_1addr *rtllib_hdr = NULL;
@@ -2446,12 +2438,12 @@
 
 }
 
-void rtl8192_rx_cmd(struct net_device *dev)
+static void rtl8192_rx_cmd(struct net_device *dev)
 {
 }
 
 
-void rtl8192_tx_resume(struct net_device *dev)
+static void rtl8192_tx_resume(struct net_device *dev)
 {
 	struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
 	struct rtllib_device *ieee = priv->rtllib;
@@ -2504,7 +2496,7 @@
 }
 
 
-int rtl8192_open(struct net_device *dev)
+static int rtl8192_open(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	int ret;
@@ -2527,7 +2519,7 @@
 }
 
 
-int rtl8192_close(struct net_device *dev)
+static int rtl8192_close(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	int ret;
@@ -2591,7 +2583,7 @@
 }
 
 
-int r8192_set_mac_adr(struct net_device *dev, void *mac)
+static int r8192_set_mac_adr(struct net_device *dev, void *mac)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	struct sockaddr *addr = mac;
@@ -2607,7 +2599,7 @@
 }
 
 /* based on ipw2200 driver */
-int rtl8192_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+static int rtl8192_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
 	struct iwreq *wrq = (struct iwreq *)rq;
@@ -2731,56 +2723,6 @@
 	return ret;
 }
 
-void FairBeacon(struct net_device *dev)
-{
-	struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
-	struct rtllib_network *net = &priv->rtllib->current_network;
-	static u8 i = 100;
-	static u8 forceturn;
-	u16 beaconint = net->beacon_interval;
-
-	if (priv->rtllib->iw_mode != IW_MODE_ADHOC)
-		return;
-
-	if (priv->bIbssCoordinator) {
-		i--;
-
-		if (forceturn == 2) {
-			forceturn = 0;
-			priv->rtllib->SetHwRegHandler(dev,
-						      HW_VAR_BEACON_INTERVAL,
-						      (u8 *)(&beaconint));
-			i = 100;
-		}
-
-		if (i <= 94) {
-			beaconint = beaconint+2;
-			priv->rtllib->SetHwRegHandler(dev,
-						      HW_VAR_BEACON_INTERVAL,
-						      (u8 *)(&beaconint));
-			forceturn = 1;
-		}
-	} else {
-		i++;
-
-		if (forceturn == 1) {
-			forceturn = 0;
-			priv->rtllib->SetHwRegHandler(dev,
-						      HW_VAR_BEACON_INTERVAL,
-						      (u8 *)(&beaconint));
-			i = 100;
-		}
-
-		if (i >= 106) {
-			beaconint = beaconint-2;
-			priv->rtllib->SetHwRegHandler(dev,
-						      HW_VAR_BEACON_INTERVAL,
-						      (u8 *)(&beaconint));
-			forceturn = 2;
-		}
-	}
-}
-
 
 irqreturn_type rtl8192_interrupt(int irq, void *netdev, struct pt_regs *regs)
 {
@@ -3077,7 +3019,7 @@
 	if (dev) {
 		if (priv->irq) {
 			free_irq(dev->irq, dev);
-			dev->irq = 0;
+			priv->irq = 0;
 		}
 		free_rtllib(dev);
 	}
@@ -3127,7 +3069,7 @@
 		kfree(priv->scan_cmd);
 
 		if (dev->mem_start != 0) {
-			iounmap((void *)dev->mem_start);
+			iounmap((void __iomem *)dev->mem_start);
 			release_mem_region(pci_resource_start(pdev, 1),
 					pci_resource_len(pdev, 1));
 		}
diff --git a/drivers/staging/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl_core.h
index 03a86fe..5b78530 100644
--- a/drivers/staging/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl_core.h
@@ -1110,7 +1110,6 @@
 u8 rtl819x_query_rxpwrpercentage(char antpower);
 void rtl8192_record_rxdesc_forlateruse(struct rtllib_rx_stats *psrc_stats,
 				       struct rtllib_rx_stats *ptarget_stats);
-
 bool NicIFEnableNIC(struct net_device *dev);
 bool NicIFDisableNIC(struct net_device *dev);
 
diff --git a/drivers/staging/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl_dm.c
index 6d201ec..a7fa9aa 100644
--- a/drivers/staging/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl_dm.c
@@ -134,8 +134,7 @@
 static	void	dm_ctstoself(struct net_device *dev);
 /*---------------------------Define function prototype------------------------*/
 
-extern	void
-init_hal_dm(struct net_device *dev)
+void init_hal_dm(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	priv->DM_Type = DM_Type_ByDriver;
@@ -158,14 +157,14 @@
 	INIT_DELAYED_WORK_RSL(&priv->gpio_change_rf_wq, (void *)dm_CheckRfCtrlGPIO, dev);
 }
 
-extern void deinit_hal_dm(struct net_device *dev)
+void deinit_hal_dm(struct net_device *dev)
 {
 
 	dm_deInit_fsync(dev);
 
 }
 
-extern  void    hal_dm_watchdog(struct net_device *dev)
+void hal_dm_watchdog(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	if (priv->being_init_adapter)
@@ -191,7 +190,7 @@
 	dm_ctstoself(dev);
 }
 
-void dm_check_ac_dc_power(struct net_device *dev)
+static void dm_check_ac_dc_power(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	static char *ac_dc_check_script_path = "/etc/acpi/wireless-rtl-ac-dc-power.sh";
@@ -215,7 +214,7 @@
 };
 
 
-extern void init_rate_adaptive(struct net_device *dev)
+void init_rate_adaptive(struct net_device *dev)
 {
 
 	struct r8192_priv *priv = rtllib_priv(dev);
@@ -1528,10 +1527,7 @@
 	}
 	}
 
-extern void dm_cck_txpower_adjust(
-	struct net_device *dev,
-	bool  binch14
-)
+void dm_cck_txpower_adjust(struct net_device *dev, bool  binch14)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	if (priv->IC_Cut >= IC_VersionCut_D)
@@ -1540,9 +1536,7 @@
 		dm_CCKTxPowerAdjust_ThermalMeter(dev, binch14);
 }
 
-static void dm_txpower_reset_recovery(
-	struct net_device *dev
-)
+static void dm_txpower_reset_recovery(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 
@@ -1570,7 +1564,7 @@
 
 }
 
-extern void dm_restore_dynamic_mechanism_state(struct net_device *dev)
+void dm_restore_dynamic_mechanism_state(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u32	reg_ratr = priv->rate_adaptive.last_ratr;
@@ -1624,7 +1618,7 @@
 }
 
 
-extern void dm_backup_dynamic_mechanism_state(struct net_device *dev)
+void dm_backup_dynamic_mechanism_state(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 
@@ -1659,8 +1653,8 @@
 
 }
 
-extern void dm_change_dynamic_initgain_thresh(struct net_device *dev,
-					      u32 dm_type, u32 dm_value)
+void dm_change_dynamic_initgain_thresh(struct net_device *dev,
+				       u32 dm_type, u32 dm_value)
 {
 	if (dm_type == DIG_TYPE_THRESH_HIGH) {
 		dm_digtable.rssi_high_thresh = dm_value;
@@ -1704,75 +1698,6 @@
 		dm_digtable.rx_gain_range_max = (u8)dm_value;
 	}
 }
-extern	void dm_change_fsync_setting(struct net_device *dev,
-	s32		DM_Type,
-	s32		DM_Value)
-{
-	struct r8192_priv *priv = rtllib_priv(dev);
-
-	if (DM_Type == 0) {
-		if (DM_Value > 1)
-			DM_Value = 1;
-		priv->framesyncMonitor = (u8)DM_Value;
-	}
-}
-
-extern void
-dm_change_rxpath_selection_setting(
-	struct net_device *dev,
-	s32		DM_Type,
-	s32		DM_Value)
-{
-	struct r8192_priv *priv = rtllib_priv(dev);
-	struct rate_adaptive *pRA = (struct rate_adaptive *)&(priv->rate_adaptive);
-
-
-	if (DM_Type == 0) {
-		if (DM_Value > 1)
-			DM_Value = 1;
-		DM_RxPathSelTable.Enable = (u8)DM_Value;
-	} else if (DM_Type == 1) {
-		if (DM_Value > 1)
-			DM_Value = 1;
-		DM_RxPathSelTable.DbgMode = (u8)DM_Value;
-	} else if (DM_Type == 2) {
-		if (DM_Value > 40)
-			DM_Value = 40;
-		DM_RxPathSelTable.SS_TH_low = (u8)DM_Value;
-	} else if (DM_Type == 3) {
-		if (DM_Value > 25)
-			DM_Value = 25;
-		DM_RxPathSelTable.diff_TH = (u8)DM_Value;
-	} else if (DM_Type == 4) {
-		if (DM_Value >= CCK_Rx_Version_MAX)
-			DM_Value = CCK_Rx_Version_1;
-		DM_RxPathSelTable.cck_method = (u8)DM_Value;
-	} else if (DM_Type == 10) {
-		if (DM_Value > 100)
-			DM_Value = 50;
-		DM_RxPathSelTable.rf_rssi[0] = (u8)DM_Value;
-	} else if (DM_Type == 11) {
-		if (DM_Value > 100)
-			DM_Value = 50;
-		DM_RxPathSelTable.rf_rssi[1] = (u8)DM_Value;
-	} else if (DM_Type == 12) {
-		if (DM_Value > 100)
-			DM_Value = 50;
-		DM_RxPathSelTable.rf_rssi[2] = (u8)DM_Value;
-	} else if (DM_Type == 13) {
-		if (DM_Value > 100)
-			DM_Value = 50;
-		DM_RxPathSelTable.rf_rssi[3] = (u8)DM_Value;
-	} else if (DM_Type == 20) {
-		if (DM_Value > 1)
-			DM_Value = 1;
-		pRA->ping_rssi_enable = (u8)DM_Value;
-	} else if (DM_Type == 21) {
-		if (DM_Value > 30)
-			DM_Value = 30;
-		pRA->ping_rssi_thresh_for_ra = DM_Value;
-	}
-}
 
 static void dm_dig_init(struct net_device *dev)
 {
@@ -1814,37 +1739,6 @@
 	dm_digtable.BackoffVal_range_min = DM_DIG_BACKOFF_MIN;
 }
 
-void dm_FalseAlarmCounterStatistics(struct net_device *dev)
-{
-	struct r8192_priv *priv = rtllib_priv(dev);
-	u32 ret_value;
-	struct false_alarm_stats *FalseAlmCnt = &(priv->FalseAlmCnt);
-
-	ret_value = rtl8192_QueryBBReg(dev, rOFDM_PHYCounter1, bMaskDWord);
-	FalseAlmCnt->Cnt_Parity_Fail = ((ret_value&0xffff0000)>>16);
-
-	ret_value = rtl8192_QueryBBReg(dev, rOFDM_PHYCounter2, bMaskDWord);
-	FalseAlmCnt->Cnt_Rate_Illegal = (ret_value&0xffff);
-	FalseAlmCnt->Cnt_Crc8_fail = ((ret_value&0xffff0000)>>16);
-	ret_value = rtl8192_QueryBBReg(dev, rOFDM_PHYCounter3, bMaskDWord);
-	FalseAlmCnt->Cnt_Mcs_fail = (ret_value&0xffff);
-
-	FalseAlmCnt->Cnt_Ofdm_fail = FalseAlmCnt->Cnt_Parity_Fail + FalseAlmCnt->Cnt_Rate_Illegal +
-				     FalseAlmCnt->Cnt_Crc8_fail + FalseAlmCnt->Cnt_Mcs_fail;
-
-	ret_value = rtl8192_QueryBBReg(dev, 0xc64, bMaskDWord);
-	FalseAlmCnt->Cnt_Cck_fail = (ret_value&0xffff);
-	FalseAlmCnt->Cnt_all = (FalseAlmCnt->Cnt_Parity_Fail +
-						FalseAlmCnt->Cnt_Rate_Illegal +
-						FalseAlmCnt->Cnt_Crc8_fail +
-						FalseAlmCnt->Cnt_Mcs_fail +
-						FalseAlmCnt->Cnt_Cck_fail);
-
-	RT_TRACE(COMP_DIG, "Cnt_Ofdm_fail = %d, Cnt_Cck_fail = %d, Cnt_all = %d\n",
-		 FalseAlmCnt->Cnt_Ofdm_fail, FalseAlmCnt->Cnt_Cck_fail,
-		 FalseAlmCnt->Cnt_all);
-}
-
 static void dm_ctrl_initgain_byrssi(struct net_device *dev)
 {
 
@@ -2099,91 +1993,6 @@
 	}
 }
 
-void dm_initial_gain_STABeforeConnect(
-	struct net_device *dev)
-{
-	struct r8192_priv *priv = rtllib_priv(dev);
-	u8 initial_gain = 0;
-	static u8 initialized, force_write;
-
-	RT_TRACE(COMP_DIG, "PreSTAConnectState = %x, CurSTAConnectState = %x\n",
-				dm_digtable.PreSTAConnectState, dm_digtable.CurSTAConnectState);
-
-
-	if ((dm_digtable.PreSTAConnectState == dm_digtable.CurSTAConnectState) ||
-		(dm_digtable.CurSTAConnectState == DIG_STA_BEFORE_CONNECT)) {
-		if (dm_digtable.CurSTAConnectState == DIG_STA_BEFORE_CONNECT) {
-			if (priv->rtllib->eRFPowerState != eRfOn)
-				return;
-
-			if (dm_digtable.Backoff_Enable_Flag == true) {
-				if (priv->FalseAlmCnt.Cnt_all > dm_digtable.FAHighThresh) {
-					if ((dm_digtable.backoff_val - 6) < dm_digtable.BackoffVal_range_min)
-						dm_digtable.backoff_val = dm_digtable.BackoffVal_range_min;
-					else
-						dm_digtable.backoff_val -= 6;
-				} else if (priv->FalseAlmCnt.Cnt_all < dm_digtable.FALowThresh) {
-					if ((dm_digtable.backoff_val + 6) > dm_digtable.BackoffVal_range_max)
-						dm_digtable.backoff_val = dm_digtable.BackoffVal_range_max;
-					else
-						dm_digtable.backoff_val += 6;
-				}
-			} else
-				dm_digtable.backoff_val = DM_DIG_BACKOFF;
-
-			if ((dm_digtable.rssi_val+10-dm_digtable.backoff_val) > dm_digtable.rx_gain_range_max)
-				dm_digtable.cur_ig_value = dm_digtable.rx_gain_range_max;
-			else if ((dm_digtable.rssi_val+10-dm_digtable.backoff_val) < dm_digtable.rx_gain_range_min)
-				dm_digtable.cur_ig_value = dm_digtable.rx_gain_range_min;
-			else
-				dm_digtable.cur_ig_value = dm_digtable.rssi_val + 10 -
-							   dm_digtable.backoff_val;
-
-			if (priv->FalseAlmCnt.Cnt_all > 10000)
-				dm_digtable.cur_ig_value = (dm_digtable.cur_ig_value > 0x33) ?
-							    dm_digtable.cur_ig_value : 0x33;
-
-			if (priv->FalseAlmCnt.Cnt_all > 16000)
-				dm_digtable.cur_ig_value = dm_digtable.rx_gain_range_max;
-
-		} else {
-			return;
-		}
-	} else {
-		dm_digtable.Dig_Ext_Port_Stage = DIG_EXT_PORT_STAGE_MAX;
-		priv->rtllib->SetFwCmdHandler(dev, FW_CMD_DIG_ENABLE);
-
-		dm_digtable.backoff_val = DM_DIG_BACKOFF;
-		dm_digtable.cur_ig_value = priv->DefaultInitialGain[0];
-		dm_digtable.pre_ig_value = 0;
-		return;
-	}
-
-	if (dm_digtable.pre_ig_value != rtl8192_QueryBBReg(dev,
-	    rOFDM0_XAAGCCore1, bMaskByte0))
-		force_write = 1;
-
-	if ((dm_digtable.pre_ig_value != dm_digtable.cur_ig_value) ||
-	     !initialized || force_write) {
-		priv->rtllib->SetFwCmdHandler(dev, FW_CMD_DIG_DISABLE);
-
-		initial_gain = (u8)dm_digtable.cur_ig_value;
-
-		rtl8192_setBBreg(dev, rOFDM0_XAAGCCore1, bMaskByte0,
-				 initial_gain);
-		rtl8192_setBBreg(dev, rOFDM0_XBAGCCore1, bMaskByte0,
-				 initial_gain);
-		dm_digtable.pre_ig_value = dm_digtable.cur_ig_value;
-		initialized = 1;
-		force_write = 0;
-	}
-
-	RT_TRACE(COMP_DIG, "CurIGValue = 0x%x, pre_ig_value = 0x%x, "
-		 "backoff_val = %d\n", dm_digtable.cur_ig_value,
-		 dm_digtable.pre_ig_value, dm_digtable.backoff_val);
-
-}
-
 static void dm_pd_th(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
@@ -2287,7 +2096,7 @@
 	}
 }
 
-extern void dm_init_edca_turbo(struct net_device *dev)
+void dm_init_edca_turbo(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 
@@ -2390,22 +2199,6 @@
 	lastRxOkCnt = priv->stats.rxbytesunicast;
 }
 
-extern void DM_CTSToSelfSetting(struct net_device *dev, u32 DM_Type,
-				u32 DM_Value)
-{
-	struct r8192_priv *priv = rtllib_priv((struct net_device *)dev);
-
-	if (DM_Type == 0) {
-		if (DM_Value > 1)
-			DM_Value = 1;
-		priv->rtllib->bCTSToSelfEnable = (bool)DM_Value;
-	} else if (DM_Type == 1) {
-		if (DM_Value >= 50)
-			DM_Value = 50;
-		priv->rtllib->CTSToSelfTH = (u8)DM_Value;
-	}
-}
-
 static void dm_init_ctstoself(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv((struct net_device *)dev);
@@ -2454,7 +2247,7 @@
 {
 }
 
-extern	void	dm_CheckRfCtrlGPIO(void *data)
+void dm_CheckRfCtrlGPIO(void *data)
 {
 	struct r8192_priv *priv = container_of_dwork_rsl(data,
 				  struct r8192_priv, gpio_change_rf_wq);
@@ -2791,7 +2584,7 @@
 	del_timer_sync(&priv->fsync_timer);
 }
 
-extern void dm_fsync_timer_callback(unsigned long data)
+void dm_fsync_timer_callback(unsigned long data)
 {
 	struct net_device *dev = (struct net_device *)data;
 	struct r8192_priv *priv = rtllib_priv((struct net_device *)data);
@@ -3091,7 +2884,7 @@
 	}
 }
 
-extern void dm_shadow_init(struct net_device *dev)
+void dm_shadow_init(struct net_device *dev)
 {
 	u8	page;
 	u16	offset;
diff --git a/drivers/staging/rtl8192e/rtl_eeprom.c b/drivers/staging/rtl8192e/rtl_eeprom.c
index df72a60..c1ccff4 100644
--- a/drivers/staging/rtl8192e/rtl_eeprom.c
+++ b/drivers/staging/rtl8192e/rtl_eeprom.c
@@ -25,7 +25,7 @@
 #include "rtl_core.h"
 #include "rtl_eeprom.h"
 
-void eprom_cs(struct net_device *dev, short bit)
+static void eprom_cs(struct net_device *dev, short bit)
 {
 	if (bit)
 		write_nic_byte(dev, EPROM_CMD,
@@ -39,7 +39,7 @@
 }
 
 
-void eprom_ck_cycle(struct net_device *dev)
+static void eprom_ck_cycle(struct net_device *dev)
 {
 	write_nic_byte(dev, EPROM_CMD,
 		       (1<<EPROM_CK_SHIFT) | read_nic_byte(dev, EPROM_CMD));
@@ -50,7 +50,7 @@
 }
 
 
-void eprom_w(struct net_device *dev, short bit)
+static void eprom_w(struct net_device *dev, short bit)
 {
 	if (bit)
 		write_nic_byte(dev, EPROM_CMD, (1<<EPROM_W_SHIFT) |
@@ -63,7 +63,7 @@
 }
 
 
-short eprom_r(struct net_device *dev)
+static short eprom_r(struct net_device *dev)
 {
 	short bit;
 
@@ -75,8 +75,7 @@
 	return 0;
 }
 
-
-void eprom_send_bits_string(struct net_device *dev, short b[], int len)
+static void eprom_send_bits_string(struct net_device *dev, short b[], int len)
 {
 	int i;
 
diff --git a/drivers/staging/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl_ps.c
index f39f0d3..c9a7c56 100644
--- a/drivers/staging/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl_ps.c
@@ -29,7 +29,7 @@
 #include "r8190P_rtl8256.h" /* RTL8225 Radio frontend */
 #include "r8192E_cmdpkt.h"
 
-void rtl8192_hw_sleep_down(struct net_device *dev)
+static void rtl8192_hw_sleep_down(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	unsigned long flags = 0;
@@ -115,7 +115,7 @@
 	spin_unlock_irqrestore(&priv->ps_lock, flags);
 }
 
-void InactivePsWorkItemCallback(struct net_device *dev)
+static void InactivePsWorkItemCallback(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
@@ -214,7 +214,8 @@
 	up(&priv->rtllib->ips_sem);
 }
 
-bool MgntActSet_802_11_PowerSaveMode(struct net_device *dev,	u8 rtPsMode)
+static bool MgntActSet_802_11_PowerSaveMode(struct net_device *dev,
+					    u8 rtPsMode)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 
diff --git a/drivers/staging/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl_wx.c
index f869ce3d..77ea4bb 100644
--- a/drivers/staging/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl_wx.c
@@ -22,7 +22,7 @@
 #include "dot11d.h"
 
 #define RATE_COUNT 12
-u32 rtl8192_rates[] = {
+static u32 rtl8192_rates[] = {
 	1000000, 2000000, 5500000, 11000000, 6000000, 9000000, 12000000,
 	18000000, 24000000, 36000000, 48000000, 54000000
 };
@@ -198,9 +198,9 @@
 	unsigned char num;
 };
 
-int r8192_wx_get_adhoc_peers(struct net_device *dev,
-			     struct iw_request_info *info,
-			     union iwreq_data *wrqu, char *extra)
+static int r8192_wx_get_adhoc_peers(struct net_device *dev,
+				    struct iw_request_info *info,
+				    union iwreq_data *wrqu, char *extra)
 {
 	return 0;
 }
@@ -1293,7 +1293,7 @@
 	(iw_handler)r8192_wx_get_PromiscuousMode,
 };
 
-struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
+static struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	struct rtllib_device *ieee = priv->rtllib;
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 35f70d6..745ae08 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -442,15 +442,20 @@
 	return 1;
 }
 
-bool AddReorderEntry(struct rx_ts_record *pTS, struct rx_reorder_entry *pReorderEntry)
+static bool AddReorderEntry(struct rx_ts_record *pTS,
+			    struct rx_reorder_entry *pReorderEntry)
 {
 	struct list_head *pList = &pTS->RxPendingPktList;
 
 	while (pList->next != &pTS->RxPendingPktList) {
-		if (SN_LESS(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum))
+		if (SN_LESS(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)
+		    list_entry(pList->next, struct rx_reorder_entry,
+		    List))->SeqNum))
 			pList = pList->next;
-		else if (SN_EQUAL(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum))
-			return false;
+		else if (SN_EQUAL(pReorderEntry->SeqNum,
+			((struct rx_reorder_entry *)list_entry(pList->next,
+			struct rx_reorder_entry, List))->SeqNum))
+				return false;
 		else
 			break;
 	}
@@ -539,8 +544,9 @@
 	pTS->RxIndicateSeq = 0xffff;
 }
 
-void RxReorderIndicatePacket(struct rtllib_device *ieee, struct rtllib_rxb *prxb,
-		struct rx_ts_record *pTS, u16 SeqNum)
+static void RxReorderIndicatePacket(struct rtllib_device *ieee,
+				    struct rtllib_rxb *prxb,
+				    struct rx_ts_record *pTS, u16 SeqNum)
 {
 	struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
 	struct rx_reorder_entry *pReorderEntry = NULL;
@@ -728,9 +734,9 @@
 	spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
 }
 
-u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb,
-		  struct rtllib_rx_stats *rx_stats,
-		  struct rtllib_rxb *rxb, u8 *src, u8 *dst)
+static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb,
+			 struct rtllib_rx_stats *rx_stats,
+			 struct rtllib_rxb *rxb, u8 *src, u8 *dst)
 {
 	struct rtllib_hdr_3addr  *hdr = (struct rtllib_hdr_3addr *)skb->data;
 	u16		fc = le16_to_cpu(hdr->frame_ctl);
@@ -853,8 +859,9 @@
 }
 
 
-size_t rtllib_rx_get_hdrlen(struct rtllib_device *ieee, struct sk_buff *skb,
-		 struct rtllib_rx_stats *rx_stats)
+static size_t rtllib_rx_get_hdrlen(struct rtllib_device *ieee,
+				   struct sk_buff *skb,
+				   struct rtllib_rx_stats *rx_stats)
 {
 	struct rtllib_hdr_4addr *hdr = (struct rtllib_hdr_4addr *)skb->data;
 	u16 fc = le16_to_cpu(hdr->frame_ctl);
@@ -874,8 +881,8 @@
 	return hdrlen;
 }
 
-int rtllib_rx_check_duplicate(struct rtllib_device *ieee, struct sk_buff *skb,
-			      u8 multicast)
+static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
+				     struct sk_buff *skb, u8 multicast)
 {
 	struct rtllib_hdr_4addr *hdr = (struct rtllib_hdr_4addr *)skb->data;
 	u16 fc, sc;
@@ -916,9 +923,9 @@
 	return 0;
 }
 
-void rtllib_rx_extract_addr(struct rtllib_device *ieee,
-			    struct rtllib_hdr_4addr *hdr, u8 *dst, u8 *src,
-			    u8 *bssid)
+static void rtllib_rx_extract_addr(struct rtllib_device *ieee,
+				   struct rtllib_hdr_4addr *hdr, u8 *dst,
+				   u8 *src, u8 *bssid)
 {
 	u16 fc = le16_to_cpu(hdr->frame_ctl);
 
@@ -946,8 +953,8 @@
 	}
 }
 
-int rtllib_rx_data_filter(struct rtllib_device *ieee, u16 fc, u8 *dst, u8 *src,
-			  u8 *bssid, u8 *addr2)
+static int rtllib_rx_data_filter(struct rtllib_device *ieee, u16 fc,
+				 u8 *dst, u8 *src, u8 *bssid, u8 *addr2)
 {
 	u8 zero_addr[ETH_ALEN] = {0};
 	u8 type, stype;
@@ -1004,7 +1011,7 @@
 	return 0;
 }
 
-int rtllib_rx_get_crypt(struct rtllib_device *ieee, struct sk_buff *skb,
+static int rtllib_rx_get_crypt(struct rtllib_device *ieee, struct sk_buff *skb,
 			struct rtllib_crypt_data **crypt, size_t hdrlen)
 {
 	struct rtllib_hdr_4addr *hdr = (struct rtllib_hdr_4addr *)skb->data;
@@ -1038,7 +1045,7 @@
 	return 0;
 }
 
-int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
+static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
 		      struct rtllib_rx_stats *rx_stats,
 		      struct rtllib_crypt_data *crypt, size_t hdrlen)
 {
@@ -1168,7 +1175,7 @@
 	return 0;
 }
 
-void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast, u8 nr_subframes)
+static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast, u8 nr_subframes)
 {
 	if (unicast) {
 
@@ -1184,7 +1191,7 @@
 	ieee->last_rx_ps_time = jiffies;
 }
 
-void rtllib_rx_indicate_pkt_legacy(struct rtllib_device *ieee,
+static void rtllib_rx_indicate_pkt_legacy(struct rtllib_device *ieee,
 		struct rtllib_rx_stats *rx_stats,
 		struct rtllib_rxb *rxb,
 		u8 *dst,
@@ -1243,7 +1250,7 @@
 	rxb = NULL;
 }
 
-int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
+static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
 		 struct rtllib_rx_stats *rx_stats)
 {
 	struct net_device *dev = ieee->dev;
@@ -1412,13 +1419,13 @@
 	return 0;
 }
 
-int rtllib_rx_Master(struct rtllib_device *ieee, struct sk_buff *skb,
+static int rtllib_rx_Master(struct rtllib_device *ieee, struct sk_buff *skb,
 		 struct rtllib_rx_stats *rx_stats)
 {
 	return 0;
 }
 
-int rtllib_rx_Monitor(struct rtllib_device *ieee, struct sk_buff *skb,
+static int rtllib_rx_Monitor(struct rtllib_device *ieee, struct sk_buff *skb,
 		 struct rtllib_rx_stats *rx_stats)
 {
 	struct rtllib_hdr_4addr *hdr = (struct rtllib_hdr_4addr *)skb->data;
@@ -1443,7 +1450,7 @@
 	return 1;
 }
 
-int rtllib_rx_Mesh(struct rtllib_device *ieee, struct sk_buff *skb,
+static int rtllib_rx_Mesh(struct rtllib_device *ieee, struct sk_buff *skb,
 		 struct rtllib_rx_stats *rx_stats)
 {
 	return 0;
@@ -2223,7 +2230,7 @@
 	return RetSS;
 }
 
-long rtllib_translate_todbm(u8 signal_strength_index)
+static long rtllib_translate_todbm(u8 signal_strength_index)
 {
 	long	signal_power;