rtl8188eu: Remove some Sparse problems

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2014-12-14 23:08:37 -06:00
parent 065126d8ce
commit a0c85b341e
13 changed files with 246 additions and 296 deletions

View file

@ -55,7 +55,7 @@
#define WEXT_CSCAN_HOME_DWELL_SECTION 'H'
#define WEXT_CSCAN_TYPE_SECTION 'T'
static struct mp_ioctl_handler mp_ioctl_hdl[] = {
struct mp_ioctl_handler mp_ioctl_hdl[] = {
/*0*/ GEN_HANDLER(sizeof(u32), rtl8188eu_oid_rt_pro_start_test_hdl, OID_RT_PRO_START_TEST)
GEN_HANDLER(sizeof(u32), rtl8188eu_oid_rt_pro_stop_test_hdl, OID_RT_PRO_STOP_TEST)

View file

@ -102,7 +102,7 @@ extern u8 key_2char2num(u8 hch, u8 lch);
extern u8 str_2char2num(u8 hch, u8 lch);
extern u8 convert_ip_addr(u8 hch, u8 mch, u8 lch);
u32 rtw_rates[] = {1000000,2000000,5500000,11000000,
static u32 rtw_rates[] = {1000000,2000000,5500000,11000000,
6000000,9000000,12000000,18000000,24000000,36000000,48000000,54000000};
static const char * const iw_operation_mode[] =
@ -315,6 +315,7 @@ static char *translate_scan(_adapter *padapter,
{
struct iw_event iwe;
u16 cap;
__le16 le_cap;
u32 ht_ielen = 0;
char custom[MAX_CUSTOM_LEN];
char *p;
@ -484,10 +485,10 @@ static char *translate_scan(_adapter *padapter,
/* Add mode */
iwe.cmd = SIOCGIWMODE;
_rtw_memcpy((u8 *)&cap, rtw_get_capability_from_ie(pnetwork->network.IEs), 2);
_rtw_memcpy((u8 *)&le_cap, rtw_get_capability_from_ie(pnetwork->network.IEs), 2);
cap = le16_to_cpu(cap);
cap = le16_to_cpu(le_cap);
if(cap & (WLAN_CAPABILITY_IBSS |WLAN_CAPABILITY_BSS)){
if (cap & WLAN_CAPABILITY_BSS)
@ -1953,7 +1954,7 @@ struct iw_mlme
#endif
int ret=0;
u16 reason;
__le16 reason;
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
struct iw_mlme *mlme = (struct iw_mlme *) extra;
@ -1965,25 +1966,19 @@ struct iw_mlme
reason = cpu_to_le16(mlme->reason_code);
DBG_871X("%s, cmd=%d, reason=%d\n", __FUNCTION__, mlme->cmd, reason);
switch (mlme->cmd)
{
case IW_MLME_DEAUTH:
if(!rtw_set_802_11_disassociate(padapter))
switch (mlme->cmd) {
case IW_MLME_DEAUTH:
if(!rtw_set_802_11_disassociate(padapter))
ret = -1;
break;
case IW_MLME_DISASSOC:
if(!rtw_set_802_11_disassociate(padapter))
ret = -1;
break;
case IW_MLME_DISASSOC:
if(!rtw_set_802_11_disassociate(padapter))
ret = -1;
break;
default:
return -EOPNOTSUPP;
break;
default:
return -EOPNOTSUPP;
}
return ret;
@ -3907,7 +3902,7 @@ static void rtw_dbg_mode_hdl(_adapter *padapter, u32 id, u8 *pdata, u32 len)
break;
case GEN_MP_IOCTL_SUBCODE(TRIGGER_GPIO):
DBG_871X("==> trigger gpio 0\n");
rtw_hal_set_hwreg(padapter, HW_VAR_TRIGGER_GPIO_0, 0);
rtw_hal_set_hwreg(padapter, HW_VAR_TRIGGER_GPIO_0, NULL);
break;
#ifdef CONFIG_BT_COEXIST
case GEN_MP_IOCTL_SUBCODE(SET_DM_BT):
@ -4730,6 +4725,7 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
_queue *queue = &(pmlmepriv->scanned_queue);
struct wlan_network *pnetwork = NULL;
u8 blnMatch = 0;
__be16 be_attr_content = 0;
u16 attr_content = 0;
uint attr_contentlen = 0;
u8 attr_content_str[P2P_PRIVATE_IOCTL_SET_LEN] = { 0x00 };
@ -4762,10 +4758,9 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
if ( (wpsie=rtw_get_wps_ie_from_scan_queue( &pnetwork->network.IEs[0], pnetwork->network.IELength, NULL, &wpsie_len, pnetwork->network.Reserved[0])) )
{
rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_CONF_METHOD, (u8 *)&attr_content, &attr_contentlen);
if (attr_contentlen)
{
attr_content = be16_to_cpu(attr_content);
rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_CONF_METHOD, (u8 *)&be_attr_content, &attr_contentlen);
if (attr_contentlen) {
attr_content = be16_to_cpu(be_attr_content);
sprintf(attr_content_str, "\n\nM=%.4d", attr_content);
blnMatch = 1;
}
@ -4992,12 +4987,12 @@ static int rtw_p2p_get_device_type(struct net_device *dev,
if ( (wpsie=rtw_get_wps_ie_from_scan_queue( &pnetwork->network.IEs[0], pnetwork->network.IELength, NULL, &wpsie_len, pnetwork->network.Reserved[0])) )
{
rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_PRIMARY_DEV_TYPE, dev_type, &dev_type_len);
if (dev_type_len)
{
u16 type = 0;
if (dev_type_len) {
__be16 be_type;
u16 type;
_rtw_memcpy(&type, dev_type, 2);
type = be16_to_cpu(type);
_rtw_memcpy(&be_type, dev_type, 2);
type = be16_to_cpu(be_type);
sprintf(dev_type_str, "\n\nN=%.2d", type);
blnMatch = 1;
}
@ -6727,7 +6722,7 @@ void rf_reg_dump(_adapter *padapter)
#endif
void mac_reg_dump(_adapter *padapter)
static void mac_reg_dump(_adapter *padapter)
{
int i,j=1;
printk("\n======= MAC REG =======\n");
@ -9205,7 +9200,7 @@ static int rtw_mp_efuse_get(struct net_device *dev,
u8 *data = NULL;
u8 *rawdata = NULL;
char *pch, *ptmp, *token, *tmp[3]={0x00,0x00,0x00};
char *pch, *ptmp, *token, *tmp[3]={NULL, NULL, NULL};
u8 ips_mode,lps_mode;
u16 i=0, j=0, mapLen=0, addr=0, cnts=0;
u16 max_available_size=0, raw_cursize=0, raw_maxsize=0;
@ -9779,7 +9774,7 @@ static int rtw_mp_efuse_set(struct net_device *dev,
u8 *ShadowMapBT = NULL;
u8 *ShadowMapWiFi = NULL;
u8 *setrawdata = NULL;
char *pch, *ptmp, *token, *tmp[3]={0x00,0x00,0x00};
char *pch, *ptmp, *token, *tmp[3]={NULL, NULL, NULL};
u16 addr=0, cnts=0, max_available_size=0;
int err;

View file

@ -47,7 +47,7 @@
#include <linux/irq.h>
#endif
const char *android_wifi_cmd_str[ANDROID_WIFI_CMD_MAX] = {
static const char *android_wifi_cmd_str[ANDROID_WIFI_CMD_MAX] = {
"START",
"STOP",
"SCAN-ACTIVE",
@ -128,7 +128,7 @@ typedef struct android_wifi_priv_cmd {
*/
static int g_wifi_on = _TRUE;
unsigned int oob_irq;
static unsigned int oob_irq;
#ifdef PNO_SUPPORT
static int wl_android_set_pno_setup(struct net_device *dev, char *command, int total_len)
@ -248,7 +248,7 @@ int rtw_android_cmdstr_to_num(char *cmdstr)
return cmd_num;
}
int rtw_android_get_rssi(struct net_device *net, char *command, int total_len)
static int rtw_android_get_rssi(struct net_device *net, char *command, int total_len)
{
_adapter *padapter = (_adapter *)rtw_netdev_priv(net);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
@ -263,7 +263,7 @@ int rtw_android_get_rssi(struct net_device *net, char *command, int total_len)
return bytes_written;
}
int rtw_android_get_link_speed(struct net_device *net, char *command, int total_len)
static int rtw_android_get_link_speed(struct net_device *net, char *command, int total_len)
{
_adapter *padapter = (_adapter *)rtw_netdev_priv(net);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
@ -277,7 +277,7 @@ int rtw_android_get_link_speed(struct net_device *net, char *command, int total_
return bytes_written;
}
int rtw_android_get_macaddr(struct net_device *net, char *command, int total_len)
static int rtw_android_get_macaddr(struct net_device *net, char *command, int total_len)
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
int bytes_written = 0;
@ -286,7 +286,7 @@ int rtw_android_get_macaddr(struct net_device *net, char *command, int total_len
return bytes_written;
}
int rtw_android_set_country(struct net_device *net, char *command, int total_len)
static int rtw_android_set_country(struct net_device *net, char *command, int total_len)
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
char *country_code = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_COUNTRY]) + 1;
@ -297,7 +297,7 @@ int rtw_android_set_country(struct net_device *net, char *command, int total_len
return (ret==_SUCCESS)?0:-1;
}
int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, int total_len)
static int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, int total_len)
{
int bytes_written = 0;
@ -308,7 +308,7 @@ int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, int tota
return bytes_written;
}
int rtw_android_set_block(struct net_device *net, char *command, int total_len)
static int rtw_android_set_block(struct net_device *net, char *command, int total_len)
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
char *block_value = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_BLOCK]) + 1;
@ -320,7 +320,7 @@ int rtw_android_set_block(struct net_device *net, char *command, int total_len)
return 0;
}
int get_int_from_command( char* pcmd )
static int get_int_from_command(char *pcmd)
{
int i = 0;
@ -526,7 +526,6 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
#ifdef CONFIG_WFD
case ANDROID_WIFI_CMD_WFD_ENABLE:
{
// Commented by Albert 2012/07/24
// We can enable the WFD function by using the following command:
// wpa_cli driver wfd-enable
@ -535,10 +534,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
pwfd_info->wfd_enable = _TRUE;
break;
}
case ANDROID_WIFI_CMD_WFD_DISABLE:
{
// Commented by Albert 2012/07/24
// We can disable the WFD function by using the following command:
// wpa_cli driver wfd-disable
@ -547,22 +543,17 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
pwfd_info->wfd_enable = _FALSE;
break;
}
case ANDROID_WIFI_CMD_WFD_SET_TCPPORT:
{
// Commented by Albert 2012/07/24
// We can set the tcp port number by using the following command:
// wpa_cli driver wfd-set-tcpport = 554
pwfd_info = &padapter->wfd_info;
if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
pwfd_info->rtsp_ctrlport = ( u16 ) get_int_from_command( priv_cmd.buf );
pwfd_info->rtsp_ctrlport = (u16)get_int_from_command(priv_cmd.buf);
break;
}
case ANDROID_WIFI_CMD_WFD_SET_MAX_TPUT:
{
break;
}
case ANDROID_WIFI_CMD_WFD_SET_DEVTYPE:
{
// Commented by Albert 2012/08/28
@ -572,9 +563,8 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
_adapter* padapter = ( _adapter * ) rtw_netdev_priv(net);
pwfd_info = &padapter->wfd_info;
if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
{
pwfd_info->wfd_device_type = ( u8 ) get_int_from_command( priv_cmd.buf );
if (padapter->wdinfo.driver_interface == DRIVER_CFG80211) {
pwfd_info->wfd_device_type = (u8)get_int_from_command(priv_cmd.buf);
pwfd_info->wfd_device_type &= WFD_DEVINFO_DUAL;
}

View file

@ -306,7 +306,7 @@ static void rtw_check_xmit_resource(_adapter *padapter, _pkt *pkt)
}
#ifdef CONFIG_TX_MCAST2UNI
int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb)
static int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb)
{
struct sta_priv *pstapriv = &padapter->stapriv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;