Skip to contentSkip to conversation

Staging: rtl8723au: Remove unnecessary variable

PATCH In review Bhumika Goyal 2 participants 4 messages Feb 9, 2016 – Feb 10, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rtl8723au: Remove unnecessary variable

Variable ret is initially made 0 and it's value remains unchanged in function. It is used only as return value.So remove ret and replace return ret with return 0.

---
 drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +2 -4
index 0ae2180..b10fdce 100644
@@ -242,7 +242,6 @@ rtw_cfg80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = {
 static int rtw_cfg80211_inform_bss(struct rtw_adapter *padapter,
 				   struct wlan_network *pnetwork)
 {
-	int ret = 0;
 	struct ieee80211_channel *notify_channel;
 	struct cfg80211_bss *bss;
 	u16 channel;
@@ -295,7 +294,7 @@ static int rtw_cfg80211_inform_bss(struct rtw_adapter *padapter,
 
 	cfg80211_put_bss(wiphy, bss);
 
-	return ret;
+	return 0;
 }
 
 void rtw_cfg80211_indicate_connect(struct rtw_adapter *padapter)
@@ -1300,7 +1299,6 @@ void rtw_cfg80211_surveydone_event_callback(struct rtw_adapter *padapter)
 static int rtw_cfg80211_set_probe_req_wpsp2pie(struct rtw_adapter *padapter,
 					       char *buf, int len)
 {
-	int ret = 0;
 	const u8 *wps_ie;
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
@@ -1330,7 +1328,7 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct rtw_adapter *padapter,
 		}
 	}
 
-	return ret;
+	return 0;
 }
 
 static int cfg80211_rtw_scan(struct wiphy *wiphy,
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Bhumika Goyal

Variable ret is initially made 0 and it's value remains unchanged in function. It is used only as return value.So remove ret and replace return ret with return 0.

"it's" -> "its". And please always put a space after a period, when there is another following sentence.

Otherwise, the change looks fine.

Quoted 54 lines
---
 drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +2 -4
index 0ae2180..b10fdce 100644
@@ -242,7 +242,6 @@ rtw_cfg80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = {
 static int rtw_cfg80211_inform_bss(struct rtw_adapter *padapter,
 				   struct wlan_network *pnetwork)
 {
-	int ret = 0;
 	struct ieee80211_channel *notify_channel;
 	struct cfg80211_bss *bss;
 	u16 channel;
@@ -295,7 +294,7 @@ static int rtw_cfg80211_inform_bss(struct rtw_adapter *padapter,
 
 	cfg80211_put_bss(wiphy, bss);
 
-	return ret;
+	return 0;
 }
 
 void rtw_cfg80211_indicate_connect(struct rtw_adapter *padapter)
@@ -1300,7 +1299,6 @@ void rtw_cfg80211_surveydone_event_callback(struct rtw_adapter *padapter)
 static int rtw_cfg80211_set_probe_req_wpsp2pie(struct rtw_adapter *padapter,
 					       char *buf, int len)
 {
-	int ret = 0;
 	const u8 *wps_ie;
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
@@ -1330,7 +1328,7 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct rtw_adapter *padapter,
 		}
 	}
 
-	return ret;
+	return 0;
 }
 
 static int cfg80211_rtw_scan(struct wiphy *wiphy,
Signature · 8 lines
1.9.1

-- 
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1455044948-1425-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
#2 lore raw

I am so sorry for such silly errors. Should I send v2 ?

Thanks,
Bhumika Goyal

#3 lore raw
Quoted 1 line · Bhumika Goyal

I am so sorry for such silly errors. Should I send v2 ?

I don have the patch that this refers to any more, but if you think that v2 might be useful, it probably is :)

julia

Quoted 15 lines

Thanks,
Bhumika Goyal

--
You received this message because you are subscribed to the Google Groups
"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/b4c83b1e-33bf-441e-b85b- 445d768f8870%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.