public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: Fix Unneeded variable: "ret". Return "0"
@ 2019-06-07  3:10 Shobhit Kukreti
  2019-06-07  6:41 ` Bastien Nocera
  0 siblings, 1 reply; 2+ messages in thread
From: Shobhit Kukreti @ 2019-06-07  3:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, linux-kernel, Bastien Nocera,
	Hans de Goede, Larry Finger

coccicheck reported Unneeded variable ret at rtl8723bs/core/rtw_ap.c:1400.
Function "rtw_acl_remove_sta" always returns 0. Modified return type of the
function to void.

Signed-off-by: Shobhit Kukreti <shobhitkukreti@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_ap.c        | 4 +---
 drivers/staging/rtl8723bs/include/rtw_ap.h     | 2 +-
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 3 ++-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 7bebb41..87b201a 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -1394,10 +1394,9 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
 	return ret;
 }
 
-int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
+void rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
 {
 	struct list_head	*plist, *phead;
-	int ret = 0;
 	struct rtw_wlan_acl_node *paclnode;
 	struct sta_priv *pstapriv = &padapter->stapriv;
 	struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
@@ -1438,7 +1437,6 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
 
 	DBG_871X("%s, acl_num =%d\n", __func__, pacl_list->num);
 
-	return ret;
 }
 
 u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta)
diff --git a/drivers/staging/rtl8723bs/include/rtw_ap.h b/drivers/staging/rtl8723bs/include/rtw_ap.h
index d6f3a3a..4a1ed9e 100644
--- a/drivers/staging/rtl8723bs/include/rtw_ap.h
+++ b/drivers/staging/rtl8723bs/include/rtw_ap.h
@@ -19,7 +19,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len);
 void rtw_ap_restore_network(struct adapter *padapter);
 void rtw_set_macaddr_acl(struct adapter *padapter, int mode);
 int rtw_acl_add_sta(struct adapter *padapter, u8 *addr);
-int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr);
+void rtw_acl_remove_sta(struct adapter *padapter, u8 *addr);
 
 u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta);
 int rtw_ap_set_group_key(struct adapter *padapter, u8 *key, u8 alg, int keyid);
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 236a462..9da1fd2 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -4174,7 +4174,8 @@ static int rtw_ioctl_acl_remove_sta(struct net_device *dev, struct ieee_param *p
 		return -EINVAL;
 	}
 
-	return rtw_acl_remove_sta(padapter, param->sta_addr);
+	rtw_acl_remove_sta(padapter, param->sta_addr);
+	return 0;
 
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: rtl8723bs: Fix Unneeded variable: "ret". Return "0"
  2019-06-07  3:10 [PATCH] staging: rtl8723bs: Fix Unneeded variable: "ret". Return "0" Shobhit Kukreti
@ 2019-06-07  6:41 ` Bastien Nocera
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien Nocera @ 2019-06-07  6:41 UTC (permalink / raw)
  To: Shobhit Kukreti, Greg Kroah-Hartman, devel, linux-kernel,
	Hans de Goede, Larry Finger

On Thu, 2019-06-06 at 20:10 -0700, Shobhit Kukreti wrote:
> coccicheck reported Unneeded variable ret at
> rtl8723bs/core/rtw_ap.c:1400.
> Function "rtw_acl_remove_sta" always returns 0. Modified return type
> of the
> function to void.
> 
> Signed-off-by: Shobhit Kukreti <shobhitkukreti@gmail.com>

Looks good, thanks.

Reviewed-by: Bastien Nocera <hadess@hadess.net>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-07  6:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-07  3:10 [PATCH] staging: rtl8723bs: Fix Unneeded variable: "ret". Return "0" Shobhit Kukreti
2019-06-07  6:41 ` Bastien Nocera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox