Commit 4d7dc178 authored by Ivan Safonov's avatar Ivan Safonov Committed by Greg Kroah-Hartman

staging: r8188eu: remove unnecessary type cast of rtw_netdev_priv() result

The type cast
padapter = (struct adapter *)rtw_netdev_priv(dev);
do nothing because type of rtw_netdev_priv() result
is (struct adapter *).
Signed-off-by: default avatarIvan Safonov <insafonov@gmail.com>
Link: https://lore.kernel.org/r/20200815203306.121039-1-insafonov@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2147dd40
...@@ -33,7 +33,7 @@ int proc_set_write_reg(struct file *file, const char __user *buffer, ...@@ -33,7 +33,7 @@ int proc_set_write_reg(struct file *file, const char __user *buffer,
unsigned long count, void *data) unsigned long count, void *data)
{ {
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = rtw_netdev_priv(dev);
char tmp[32]; char tmp[32];
u32 addr, val, len; u32 addr, val, len;
...@@ -75,7 +75,7 @@ int proc_get_read_reg(char *page, char **start, ...@@ -75,7 +75,7 @@ int proc_get_read_reg(char *page, char **start,
int *eof, void *data) int *eof, void *data)
{ {
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = rtw_netdev_priv(dev);
int len = 0; int len = 0;
...@@ -135,7 +135,7 @@ int proc_get_adapter_state(char *page, char **start, ...@@ -135,7 +135,7 @@ int proc_get_adapter_state(char *page, char **start,
int *eof, void *data) int *eof, void *data)
{ {
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = rtw_netdev_priv(dev);
int len = 0; int len = 0;
len += scnprintf(page + len, count - len, "bSurpriseRemoved=%d, bDriverStopped=%d\n", len += scnprintf(page + len, count - len, "bSurpriseRemoved=%d, bDriverStopped=%d\n",
...@@ -150,7 +150,7 @@ int proc_get_best_channel(char *page, char **start, ...@@ -150,7 +150,7 @@ int proc_get_best_channel(char *page, char **start,
int *eof, void *data) int *eof, void *data)
{ {
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = rtw_netdev_priv(dev);
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
int len = 0; int len = 0;
u32 i, best_channel_24G = 1, index_24G = 0; u32 i, best_channel_24G = 1, index_24G = 0;
......
...@@ -84,7 +84,7 @@ static int rtw_hw_resume(struct adapter *padapter) ...@@ -84,7 +84,7 @@ static int rtw_hw_resume(struct adapter *padapter)
pwrpriv->bips_processing = true; pwrpriv->bips_processing = true;
rtw_reset_drv_sw(padapter); rtw_reset_drv_sw(padapter);
if (ips_netdrv_open((struct adapter *)rtw_netdev_priv(pnetdev)) != _SUCCESS) { if (ips_netdrv_open(rtw_netdev_priv(pnetdev)) != _SUCCESS) {
mutex_unlock(&pwrpriv->mutex_lock); mutex_unlock(&pwrpriv->mutex_lock);
goto error_exit; goto error_exit;
} }
......
...@@ -187,7 +187,7 @@ static void loadparam(struct adapter *padapter, struct net_device *pnetdev) ...@@ -187,7 +187,7 @@ static void loadparam(struct adapter *padapter, struct net_device *pnetdev)
static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p) static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p)
{ {
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev); struct adapter *padapter = rtw_netdev_priv(pnetdev);
struct sockaddr *addr = p; struct sockaddr *addr = p;
if (!padapter->bup) if (!padapter->bup)
...@@ -198,7 +198,7 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p) ...@@ -198,7 +198,7 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p)
static struct net_device_stats *rtw_net_get_stats(struct net_device *pnetdev) static struct net_device_stats *rtw_net_get_stats(struct net_device *pnetdev)
{ {
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev); struct adapter *padapter = rtw_netdev_priv(pnetdev);
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct recv_priv *precvpriv = &padapter->recvpriv; struct recv_priv *precvpriv = &padapter->recvpriv;
...@@ -543,7 +543,7 @@ static int _netdev_open(struct net_device *pnetdev) ...@@ -543,7 +543,7 @@ static int _netdev_open(struct net_device *pnetdev)
{ {
uint status; uint status;
int err; int err;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev); struct adapter *padapter = rtw_netdev_priv(pnetdev);
struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv; struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+88eu_drv - dev_open\n")); RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+88eu_drv - dev_open\n"));
...@@ -612,7 +612,7 @@ static int _netdev_open(struct net_device *pnetdev) ...@@ -612,7 +612,7 @@ static int _netdev_open(struct net_device *pnetdev)
int netdev_open(struct net_device *pnetdev) int netdev_open(struct net_device *pnetdev)
{ {
int ret; int ret;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev); struct adapter *padapter = rtw_netdev_priv(pnetdev);
if (mutex_lock_interruptible(&padapter->hw_init_mutex)) if (mutex_lock_interruptible(&padapter->hw_init_mutex))
return -ERESTARTSYS; return -ERESTARTSYS;
...@@ -698,7 +698,7 @@ void rtw_ips_dev_unload(struct adapter *padapter) ...@@ -698,7 +698,7 @@ void rtw_ips_dev_unload(struct adapter *padapter)
static int netdev_close(struct net_device *pnetdev) static int netdev_close(struct net_device *pnetdev)
{ {
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev); struct adapter *padapter = rtw_netdev_priv(pnetdev);
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+88eu_drv - drv_close\n")); RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+88eu_drv - drv_close\n"));
......
...@@ -76,7 +76,7 @@ int rtw_android_cmdstr_to_num(char *cmdstr) ...@@ -76,7 +76,7 @@ int rtw_android_cmdstr_to_num(char *cmdstr)
static int rtw_android_get_rssi(struct net_device *net, char *command, static int rtw_android_get_rssi(struct net_device *net, char *command,
int total_len) int total_len)
{ {
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(net); struct adapter *padapter = rtw_netdev_priv(net);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *pcur_network = &pmlmepriv->cur_network; struct wlan_network *pcur_network = &pmlmepriv->cur_network;
int bytes_written = 0; int bytes_written = 0;
...@@ -93,7 +93,7 @@ static int rtw_android_get_rssi(struct net_device *net, char *command, ...@@ -93,7 +93,7 @@ static int rtw_android_get_rssi(struct net_device *net, char *command,
static int rtw_android_get_link_speed(struct net_device *net, char *command, static int rtw_android_get_link_speed(struct net_device *net, char *command,
int total_len) int total_len)
{ {
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(net); struct adapter *padapter = rtw_netdev_priv(net);
u16 link_speed; u16 link_speed;
link_speed = rtw_get_cur_max_rate(padapter) / 10; link_speed = rtw_get_cur_max_rate(padapter) / 10;
...@@ -111,7 +111,7 @@ static int rtw_android_get_macaddr(struct net_device *net, char *command, ...@@ -111,7 +111,7 @@ static int rtw_android_get_macaddr(struct net_device *net, char *command,
static int android_set_cntry(struct net_device *net, char *command, static int android_set_cntry(struct net_device *net, char *command,
int total_len) int total_len)
{ {
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(net); struct adapter *adapter = rtw_netdev_priv(net);
char *country_code = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_COUNTRY]) + 1; char *country_code = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_COUNTRY]) + 1;
int ret; int ret;
......
...@@ -164,7 +164,7 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb) ...@@ -164,7 +164,7 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev) int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
{ {
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev); struct adapter *padapter = rtw_netdev_priv(pnetdev);
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
s32 res = 0; s32 res = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment