driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] staging: rtl8188eu: core: Replace function Set_MSR()
@ 2019-07-12  7:17 Nishka Dasgupta
  2019-07-12  7:17 ` [PATCH 2/8] staging: rtl8188eu: core: Remove function enable_rate_adaptive() Nishka Dasgupta
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Nishka Dasgupta @ 2019-07-12  7:17 UTC (permalink / raw)
  To: larry.finger, gregkh, devel; +Cc: Nishka Dasgupta

Change reference to Set_NETYPE0_MSR to Set_MSR.
Replace the contents of Set_MSR with the contents of Set_NETYPE0_MSR as
Set_MSR does nothing but call Set_NETYPE0_MSR.
Delete Set_NETYPE0_MSR.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c  | 2 +-
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 7 +------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 6f3c03201f64..18dc9fc1c04a 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -4854,7 +4854,7 @@ u8 setopmode_hdl(struct adapter *padapter, u8 *pbuf)
 	}
 
 	rtw_hal_set_hwreg(padapter, HW_VAR_SET_OPMODE, (u8 *)(&type));
-	/* Set_NETYPE0_MSR(padapter, type); */
+	/* Set_MSR(padapter, type); */
 
 	return H2C_SUCCESS;
 }
diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 7bfc5b7c2757..b75568efb46f 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -270,14 +270,9 @@ void Switch_DM_Func(struct adapter *padapter, u32 mode, u8 enable)
 		rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_CLR, (u8 *)(&mode));
 }
 
-static void Set_NETYPE0_MSR(struct adapter *padapter, u8 type)
-{
-	rtw_hal_set_hwreg(padapter, HW_VAR_MEDIA_STATUS, (u8 *)(&type));
-}
-
 void Set_MSR(struct adapter *padapter, u8 type)
 {
-	Set_NETYPE0_MSR(padapter, type);
+	rtw_hal_set_hwreg(padapter, HW_VAR_MEDIA_STATUS, (u8 *)(&type));
 }
 
 inline u8 rtw_get_oper_ch(struct adapter *adapter)
-- 
2.19.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 2/8] staging: rtl8188eu: core: Remove function enable_rate_adaptive()
  2019-07-12  7:17 [PATCH 1/8] staging: rtl8188eu: core: Replace function Set_MSR() Nishka Dasgupta
@ 2019-07-12  7:17 ` Nishka Dasgupta
  2019-07-12  7:17 ` [PATCH 3/8] staging: rtl8188eu: Replace function beacon_timing_control() Nishka Dasgupta
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Nishka Dasgupta @ 2019-07-12  7:17 UTC (permalink / raw)
  To: larry.finger, gregkh, devel; +Cc: Nishka Dasgupta

Remove function enable_rate_adaptive as it does nothing except call
Update_RA_Entry.
Modify call site of enable_rate_adaptive to call Update_RA_Entry
instead.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index b75568efb46f..1f2763ff2a70 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -1174,15 +1174,10 @@ void Update_RA_Entry(struct adapter *padapter, u32 mac_id)
 	rtw_hal_update_ra_mask(padapter, mac_id, 0);
 }
 
-static void enable_rate_adaptive(struct adapter *padapter, u32 mac_id)
-{
-	Update_RA_Entry(padapter, mac_id);
-}
-
 void set_sta_rate(struct adapter *padapter, struct sta_info *psta)
 {
 	/* rate adaptive */
-	enable_rate_adaptive(padapter, psta->mac_id);
+	Update_RA_Entry(padapter, psta->mac_id);
 }
 
 /*  Update RRSR and Rate for USERATE */
-- 
2.19.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 3/8] staging: rtl8188eu: Replace function beacon_timing_control()
  2019-07-12  7:17 [PATCH 1/8] staging: rtl8188eu: core: Replace function Set_MSR() Nishka Dasgupta
  2019-07-12  7:17 ` [PATCH 2/8] staging: rtl8188eu: core: Remove function enable_rate_adaptive() Nishka Dasgupta
@ 2019-07-12  7:17 ` Nishka Dasgupta
  2019-07-12  7:17 ` [PATCH 4/8] staging: rtl8188eu: Remove function rtw_os_indicate_scan_done() Nishka Dasgupta
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Nishka Dasgupta @ 2019-07-12  7:17 UTC (permalink / raw)
  To: larry.finger, gregkh, devel; +Cc: Nishka Dasgupta

Remove function beacon_timing_control as all it does is call
rtw_hal_bcn_related_reg_setting.
Rename rtw_hal_bcn_related_reg_setting to beacon_timing_control for
compatibility with call sites.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c   | 5 -----
 drivers/staging/rtl8188eu/hal/usb_halinit.c      | 2 +-
 drivers/staging/rtl8188eu/include/hal_intf.h     | 2 +-
 drivers/staging/rtl8188eu/include/rtw_mlme_ext.h | 1 -
 4 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 1f2763ff2a70..c985b1468d41 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -1466,8 +1466,3 @@ void correct_TSF(struct adapter *padapter, struct mlme_ext_priv *pmlmeext)
 {
 	rtw_hal_set_hwreg(padapter, HW_VAR_CORRECT_TSF, NULL);
 }
-
-void beacon_timing_control(struct adapter *padapter)
-{
-	rtw_hal_bcn_related_reg_setting(padapter);
-}
diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index ac5552050752..89babcb12d02 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -1934,7 +1934,7 @@ void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_level)
 	psta->init_rate = init_rate;
 }
 
-void rtw_hal_bcn_related_reg_setting(struct adapter *adapt)
+void beacon_timing_control(struct adapter *adapt)
 {
 	u32 value32;
 	struct mlme_ext_priv	*pmlmeext = &adapt->mlmeextpriv;
diff --git a/drivers/staging/rtl8188eu/include/hal_intf.h b/drivers/staging/rtl8188eu/include/hal_intf.h
index 8b65fcba1967..516a89647003 100644
--- a/drivers/staging/rtl8188eu/include/hal_intf.h
+++ b/drivers/staging/rtl8188eu/include/hal_intf.h
@@ -199,7 +199,7 @@ void	rtw_hal_add_ra_tid(struct adapter *adapt, u32 bitmap, u8 arg, u8 level);
 void	rtw_hal_clone_data(struct adapter *dst_adapt,
 			   struct adapter *src_adapt);
 
-void rtw_hal_bcn_related_reg_setting(struct adapter *padapter);
+void beacon_timing_control(struct adapter *padapter);
 
 u32	rtw_hal_read_rfreg(struct adapter *padapter, enum rf_radio_path eRFPath,
 			   u32 RegAddr, u32 BitMask);
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
index 327f7d1bc20c..d70780c8fd62 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
@@ -535,7 +535,6 @@ void report_del_sta_event(struct adapter *padapter,
 void report_add_sta_event(struct adapter *padapter, unsigned char *addr,
 			  int cam_idx);
 
-void beacon_timing_control(struct adapter *padapter);
 u8 set_tx_beacon_cmd(struct adapter *padapter);
 unsigned int setup_beacon_frame(struct adapter *padapter,
 				unsigned char *beacon_frame);
-- 
2.19.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 4/8] staging: rtl8188eu: Remove function rtw_os_indicate_scan_done()
  2019-07-12  7:17 [PATCH 1/8] staging: rtl8188eu: core: Replace function Set_MSR() Nishka Dasgupta
  2019-07-12  7:17 ` [PATCH 2/8] staging: rtl8188eu: core: Remove function enable_rate_adaptive() Nishka Dasgupta
  2019-07-12  7:17 ` [PATCH 3/8] staging: rtl8188eu: Replace function beacon_timing_control() Nishka Dasgupta
@ 2019-07-12  7:17 ` Nishka Dasgupta
  2019-07-12  7:17 ` [PATCH 5/8] staging: rtl8188eu: Remove function rtw_modular64() Nishka Dasgupta
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Nishka Dasgupta @ 2019-07-12  7:17 UTC (permalink / raw)
  To: larry.finger, gregkh, devel; +Cc: Nishka Dasgupta

In function rtw_indicate_scan_done, replace call to
rtw_os_indicate_scan_done with call to indicate_wx_scan_complete_event
as all that rtw_os_indicate_scan_done does is call
indicate_wx_scan_complete_event.
Remove now-unused function rtw_os_indicate_scan_done.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_mlme.c      | 2 +-
 drivers/staging/rtl8188eu/include/mlme_osdep.h | 1 -
 drivers/staging/rtl8188eu/os_dep/mlme_linux.c  | 5 -----
 3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index d2f7a88e992e..43c7531e777e 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -827,7 +827,7 @@ void rtw_indicate_disconnect(struct adapter *padapter)
 
 inline void rtw_indicate_scan_done(struct adapter *padapter, bool aborted)
 {
-	rtw_os_indicate_scan_done(padapter, aborted);
+	indicate_wx_scan_complete_event(padapter);
 }
 
 static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, struct wlan_network *pnetwork)
diff --git a/drivers/staging/rtl8188eu/include/mlme_osdep.h b/drivers/staging/rtl8188eu/include/mlme_osdep.h
index eda16c06336a..8e919441c2aa 100644
--- a/drivers/staging/rtl8188eu/include/mlme_osdep.h
+++ b/drivers/staging/rtl8188eu/include/mlme_osdep.h
@@ -13,7 +13,6 @@
 void rtw_init_mlme_timer(struct adapter *padapter);
 void rtw_os_indicate_disconnect(struct adapter *adapter);
 void rtw_os_indicate_connect(struct adapter *adapter);
-void rtw_os_indicate_scan_done(struct adapter *padapter, bool aborted);
 void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie);
 
 void rtw_reset_securitypriv(struct adapter *adapter);
diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
index e660bd4d91ef..321b2c46479c 100644
--- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
@@ -27,11 +27,6 @@ void rtw_os_indicate_connect(struct adapter *adapter)
 	netif_carrier_on(adapter->pnetdev);
 }
 
-void rtw_os_indicate_scan_done(struct adapter *padapter, bool aborted)
-{
-	indicate_wx_scan_complete_event(padapter);
-}
-
 static struct rt_pmkid_list backup_pmkid[NUM_PMKID_CACHE];
 
 void rtw_reset_securitypriv(struct adapter *adapter)
-- 
2.19.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 5/8] staging: rtl8188eu: Remove function rtw_modular64()
  2019-07-12  7:17 [PATCH 1/8] staging: rtl8188eu: core: Replace function Set_MSR() Nishka Dasgupta
                   ` (2 preceding siblings ...)
  2019-07-12  7:17 ` [PATCH 4/8] staging: rtl8188eu: Remove function rtw_os_indicate_scan_done() Nishka Dasgupta
@ 2019-07-12  7:17 ` Nishka Dasgupta
  2020-04-12 13:34   ` Ivan Safonov
  2019-07-12  7:17 ` [PATCH 6/8] staging: rtl8188eu: Replace function rtw_alloc_network() Nishka Dasgupta
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Nishka Dasgupta @ 2019-07-12  7:17 UTC (permalink / raw)
  To: larry.finger, gregkh, devel; +Cc: Nishka Dasgupta

Remove function rtw_modular64 as all it does is call do_div.
Replace call to rtw_modular64 with call to do_div.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/usb_halinit.c       | 2 +-
 drivers/staging/rtl8188eu/include/osdep_service.h | 2 --
 drivers/staging/rtl8188eu/os_dep/osdep_service.c  | 5 -----
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index 89babcb12d02..994392ac249b 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -1298,7 +1298,7 @@ void rtw_hal_set_hwreg(struct adapter *Adapter, u8 variable, u8 *val)
 			struct mlme_ext_priv	*pmlmeext = &Adapter->mlmeextpriv;
 			struct mlme_ext_info	*pmlmeinfo = &pmlmeext->mlmext_info;
 
-			tsf = pmlmeext->TSFValue - rtw_modular64(pmlmeext->TSFValue, (pmlmeinfo->bcn_interval*1024)) - 1024; /* us */
+			tsf = pmlmeext->TSFValue - do_div(pmlmeext->TSFValue, (pmlmeinfo->bcn_interval*1024)) - 1024; /* us */
 
 			if (((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE))
 				StopTxBeacon(Adapter);
diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h
index cfe5698fbbb1..c0114ad79788 100644
--- a/drivers/staging/rtl8188eu/include/osdep_service.h
+++ b/drivers/staging/rtl8188eu/include/osdep_service.h
@@ -80,8 +80,6 @@ void rtw_free_netdev(struct net_device *netdev);
 #define FUNC_ADPT_FMT "%s(%s)"
 #define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name
 
-u64 rtw_modular64(u64 x, u64 y);
-
 /* Macros for handling unaligned memory accesses */
 
 #define RTW_GET_BE24(a) ((((u32)(a)[0]) << 16) | (((u32) (a)[1]) << 8) | \
diff --git a/drivers/staging/rtl8188eu/os_dep/osdep_service.c b/drivers/staging/rtl8188eu/os_dep/osdep_service.c
index 105f3f21bdea..69d4b1d66b6f 100644
--- a/drivers/staging/rtl8188eu/os_dep/osdep_service.c
+++ b/drivers/staging/rtl8188eu/os_dep/osdep_service.c
@@ -59,11 +59,6 @@ void rtw_free_netdev(struct net_device *netdev)
 	return;
 }
 
-u64 rtw_modular64(u64 x, u64 y)
-{
-	return do_div(x, y);
-}
-
 void rtw_buf_free(u8 **buf, u32 *buf_len)
 {
 	*buf_len = 0;
-- 
2.19.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 6/8] staging: rtl8188eu: Replace function rtw_alloc_network()
  2019-07-12  7:17 [PATCH 1/8] staging: rtl8188eu: core: Replace function Set_MSR() Nishka Dasgupta
                   ` (3 preceding siblings ...)
  2019-07-12  7:17 ` [PATCH 5/8] staging: rtl8188eu: Remove function rtw_modular64() Nishka Dasgupta
@ 2019-07-12  7:17 ` Nishka Dasgupta
  2019-07-12  7:17 ` [PATCH 7/8] staging: rtl8188eu: Replace function rtl88e_phy_rf6052_config() Nishka Dasgupta
  2019-07-12  7:17 ` [PATCH 8/8] staging: rtl8188eu: Replace function rtl88eu_phy_rf_config() Nishka Dasgupta
  6 siblings, 0 replies; 12+ messages in thread
From: Nishka Dasgupta @ 2019-07-12  7:17 UTC (permalink / raw)
  To: larry.finger, gregkh, devel; +Cc: Nishka Dasgupta

Change external call site of _rtw_alloc_network to rtw_alloc_network.
Remove function rtw_alloc_network as all it does is call
_rtw_alloc_network.
Rename _rtw_alloc_network to rtw_alloc_network to maintain compatibility
with call sites. Keep its type as non-static (even though the old
rtw_alloc_network was static) as this functionality is used in other
files as well.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_cmd.c     | 2 +-
 drivers/staging/rtl8188eu/core/rtw_mlme.c    | 9 ++-------
 drivers/staging/rtl8188eu/include/rtw_mlme.h | 2 +-
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index a24b40761af2..815dfee11968 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -1200,7 +1200,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
 
 		rtw_indicate_connect(padapter);
 	} else {
-		pwlan = _rtw_alloc_network(pmlmepriv);
+		pwlan = rtw_alloc_network(pmlmepriv);
 		spin_lock_bh(&pmlmepriv->scanned_queue.lock);
 		if (!pwlan) {
 			pwlan = rtw_get_oldest_wlan_network(&pmlmepriv->scanned_queue);
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index 43c7531e777e..1ec3b237212e 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -104,7 +104,7 @@ void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv)
 	}
 }
 
-struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)
+struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv)
 					/* _queue *free_queue) */
 {
 	struct wlan_network *pnetwork;
@@ -119,7 +119,7 @@ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)
 	list_del_init(&pnetwork->list);
 
 	RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
-		 ("_rtw_alloc_network: ptr=%p\n", &pnetwork->list));
+		 ("rtw_alloc_network: ptr=%p\n", &pnetwork->list));
 	pnetwork->network_type = 0;
 	pnetwork->fixed = false;
 	pnetwork->last_scanned = jiffies;
@@ -272,11 +272,6 @@ u8 *rtw_get_beacon_interval_from_ie(u8 *ie)
 	return ie + 8;
 }
 
-static struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv)
-{
-	return _rtw_alloc_network(pmlmepriv);
-}
-
 int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork)
 {
 	int ret = true;
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h
index 9abb7c320192..010f0c42368a 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h
@@ -333,7 +333,7 @@ void rtw_dynamic_check_timer_handlder(struct timer_list *t);
 
 void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv);
 
-struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv);
+struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv);
 
 int rtw_if_up(struct adapter *padapter);
 
-- 
2.19.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 7/8] staging: rtl8188eu: Replace function rtl88e_phy_rf6052_config()
  2019-07-12  7:17 [PATCH 1/8] staging: rtl8188eu: core: Replace function Set_MSR() Nishka Dasgupta
                   ` (4 preceding siblings ...)
  2019-07-12  7:17 ` [PATCH 6/8] staging: rtl8188eu: Replace function rtw_alloc_network() Nishka Dasgupta
@ 2019-07-12  7:17 ` Nishka Dasgupta
  2019-07-12  7:17 ` [PATCH 8/8] staging: rtl8188eu: Replace function rtl88eu_phy_rf_config() Nishka Dasgupta
  6 siblings, 0 replies; 12+ messages in thread
From: Nishka Dasgupta @ 2019-07-12  7:17 UTC (permalink / raw)
  To: larry.finger, gregkh, devel; +Cc: Nishka Dasgupta

Remove function rtl88e_phy_rf6052_config as all it does is call
rf6052_conf_para.
Rename rf6052_conf_para to rtl88e_phy_rf6052_config to maintain
compatibility with call site.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/rf_cfg.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rf_cfg.c b/drivers/staging/rtl8188eu/hal/rf_cfg.c
index 02aeb12c9870..89ee74e795f8 100644
--- a/drivers/staging/rtl8188eu/hal/rf_cfg.c
+++ b/drivers/staging/rtl8188eu/hal/rf_cfg.c
@@ -218,7 +218,7 @@ static bool rtl88e_phy_config_rf_with_headerfile(struct adapter *adapt)
 	return true;
 }
 
-static bool rf6052_conf_para(struct adapter *adapt)
+static bool rtl88e_phy_rf6052_config(struct adapter *adapt)
 {
 	struct hal_data_8188e *hal_data = adapt->HalData;
 	u32 u4val = 0;
@@ -247,11 +247,6 @@ static bool rf6052_conf_para(struct adapter *adapt)
 	return rtstatus;
 }
 
-static bool rtl88e_phy_rf6052_config(struct adapter *adapt)
-{
-	return rf6052_conf_para(adapt);
-}
-
 bool rtl88eu_phy_rf_config(struct adapter *adapt)
 {
 	return rtl88e_phy_rf6052_config(adapt);
-- 
2.19.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 8/8] staging: rtl8188eu: Replace function rtl88eu_phy_rf_config()
  2019-07-12  7:17 [PATCH 1/8] staging: rtl8188eu: core: Replace function Set_MSR() Nishka Dasgupta
                   ` (5 preceding siblings ...)
  2019-07-12  7:17 ` [PATCH 7/8] staging: rtl8188eu: Replace function rtl88e_phy_rf6052_config() Nishka Dasgupta
@ 2019-07-12  7:17 ` Nishka Dasgupta
  6 siblings, 0 replies; 12+ messages in thread
From: Nishka Dasgupta @ 2019-07-12  7:17 UTC (permalink / raw)
  To: larry.finger, gregkh, devel; +Cc: Nishka Dasgupta

Remove function rtl88eu_phy_rf_config as all it does is call
rtl88e_phy_rf6052_config.
Rename rtl88e_phy_rf6052_config to rtl88eu_phy_rf_config and change its
type from static to non-static to maintain compatibility with call
sites.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/rf_cfg.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rf_cfg.c b/drivers/staging/rtl8188eu/hal/rf_cfg.c
index 89ee74e795f8..739e62dc60e3 100644
--- a/drivers/staging/rtl8188eu/hal/rf_cfg.c
+++ b/drivers/staging/rtl8188eu/hal/rf_cfg.c
@@ -218,7 +218,7 @@ static bool rtl88e_phy_config_rf_with_headerfile(struct adapter *adapt)
 	return true;
 }
 
-static bool rtl88e_phy_rf6052_config(struct adapter *adapt)
+bool rtl88eu_phy_rf_config(struct adapter *adapt)
 {
 	struct hal_data_8188e *hal_data = adapt->HalData;
 	u32 u4val = 0;
@@ -246,8 +246,3 @@ static bool rtl88e_phy_rf6052_config(struct adapter *adapt)
 
 	return rtstatus;
 }
-
-bool rtl88eu_phy_rf_config(struct adapter *adapt)
-{
-	return rtl88e_phy_rf6052_config(adapt);
-}
-- 
2.19.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 5/8] staging: rtl8188eu: Remove function rtw_modular64()
  2019-07-12  7:17 ` [PATCH 5/8] staging: rtl8188eu: Remove function rtw_modular64() Nishka Dasgupta
@ 2020-04-12 13:34   ` Ivan Safonov
  2020-04-14 11:56     ` Dan Carpenter
  0 siblings, 1 reply; 12+ messages in thread
From: Ivan Safonov @ 2020-04-12 13:34 UTC (permalink / raw)
  To: Nishka Dasgupta, Larry Finger, Greg Kroah-Hartman,
	Michael Straube, devel, linux-kernel

> Remove function rtw_modular64 as all it does is call do_div.

This is wrong. Macro do_div(x, y) change first argument x, but 
rtw_modular64(x, y) preserve it.

> +			tsf = pmlmeext->TSFValue - do_div(pmlmeext->TSFValue, (pmlmeinfo->bcn_interval*1024)) - 1024; /* us */

rounddown(pmlmeext->TSFValue, pmlmeinfo->bcn_interval * 1024) - 1024
is a better replacement for

> -			tsf = pmlmeext->TSFValue - rtw_modular64(pmlmeext->TSFValue, (pmlmeinfo->bcn_interval*1024)) - 1024; /* us */

Patch '[PATCH 01/10] staging: rtl8723bs: Remove function 
rtw_modular64()' have same bug.

Ivan Safonov.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 5/8] staging: rtl8188eu: Remove function rtw_modular64()
  2020-04-12 13:34   ` Ivan Safonov
@ 2020-04-14 11:56     ` Dan Carpenter
  2020-04-14 12:22       ` Ivan Safonov
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Carpenter @ 2020-04-14 11:56 UTC (permalink / raw)
  To: Ivan Safonov
  Cc: devel, Greg Kroah-Hartman, linux-kernel, Nishka Dasgupta, Larry Finger

On Sun, Apr 12, 2020 at 04:34:08PM +0300, Ivan Safonov wrote:
> > Remove function rtw_modular64 as all it does is call do_div.
> 
> This is wrong. Macro do_div(x, y) change first argument x, but
> rtw_modular64(x, y) preserve it.
> 
> > +			tsf = pmlmeext->TSFValue - do_div(pmlmeext->TSFValue, (pmlmeinfo->bcn_interval*1024)) - 1024; /* us */
> 
> rounddown(pmlmeext->TSFValue, pmlmeinfo->bcn_interval * 1024) - 1024
> is a better replacement for

You're absolutely correct that the patch is buggy, but I'm not sure that
rounddown() is what we want.

rtw_modular64() took the MOD of x.  So it should be something like:

	tsf = pmlmeext->TSFValue - (pmlmeext->TSFValue % (pmlmeinfo->bcn_interval * 1024)) - 1024; /* us */

But what the heck is that even???  If pmlmeinfo->bcn_interval is zero
or one then the subtraction ends up giving us a negative.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 5/8] staging: rtl8188eu: Remove function rtw_modular64()
  2020-04-14 11:56     ` Dan Carpenter
@ 2020-04-14 12:22       ` Ivan Safonov
  2020-04-14 13:25         ` Dan Carpenter
  0 siblings, 1 reply; 12+ messages in thread
From: Ivan Safonov @ 2020-04-14 12:22 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: devel, Greg Kroah-Hartman, linux-kernel, Nishka Dasgupta, Larry Finger

On 4/14/20 2:56 PM, Dan Carpenter wrote:
> On Sun, Apr 12, 2020 at 04:34:08PM +0300, Ivan Safonov wrote:
>>> Remove function rtw_modular64 as all it does is call do_div.
>>
>> This is wrong. Macro do_div(x, y) change first argument x, but
>> rtw_modular64(x, y) preserve it.
>>
>>> +			tsf = pmlmeext->TSFValue - do_div(pmlmeext->TSFValue, (pmlmeinfo->bcn_interval*1024)) - 1024; /* us */
>>
>> rounddown(pmlmeext->TSFValue, pmlmeinfo->bcn_interval * 1024) - 1024
>> is a better replacement for
> 
> You're absolutely correct that the patch is buggy, but I'm not sure that
> rounddown() is what we want.
> 
> rtw_modular64() took the MOD of x.  So it should be something like:
> 
> 	tsf = pmlmeext->TSFValue - (pmlmeext->TSFValue % (pmlmeinfo->bcn_interval * 1024)) - 1024; /* us */
> 
> But what the heck is that even???  If pmlmeinfo->bcn_interval is zero
> or one then the subtraction ends up giving us a negative.
> 
> regards,
> dan carpenter
> 

1. pmlmeext->TSFValue can not be negative, because it is uint64_t;
2. pmlmeext->TSFValue is cyclic value:
     https://en.wikipedia.org/wiki/Timing_synchronization_function ;
3. (rounddown(a, b)) is equal to (a - a % b) by definition.

Ivan Safonov.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 5/8] staging: rtl8188eu: Remove function rtw_modular64()
  2020-04-14 12:22       ` Ivan Safonov
@ 2020-04-14 13:25         ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2020-04-14 13:25 UTC (permalink / raw)
  To: Ivan Safonov
  Cc: devel, Greg Kroah-Hartman, linux-kernel, Nishka Dasgupta, Larry Finger

On Tue, Apr 14, 2020 at 03:22:59PM +0300, Ivan Safonov wrote:
> On 4/14/20 2:56 PM, Dan Carpenter wrote:
> > On Sun, Apr 12, 2020 at 04:34:08PM +0300, Ivan Safonov wrote:
> > > > Remove function rtw_modular64 as all it does is call do_div.
> > > 
> > > This is wrong. Macro do_div(x, y) change first argument x, but
> > > rtw_modular64(x, y) preserve it.
> > > 
> > > > +			tsf = pmlmeext->TSFValue - do_div(pmlmeext->TSFValue, (pmlmeinfo->bcn_interval*1024)) - 1024; /* us */
> > > 
> > > rounddown(pmlmeext->TSFValue, pmlmeinfo->bcn_interval * 1024) - 1024
> > > is a better replacement for
> > 
> > You're absolutely correct that the patch is buggy, but I'm not sure that
> > rounddown() is what we want.
> > 
> > rtw_modular64() took the MOD of x.  So it should be something like:
> > 
> > 	tsf = pmlmeext->TSFValue - (pmlmeext->TSFValue % (pmlmeinfo->bcn_interval * 1024)) - 1024; /* us */
> > 
> > But what the heck is that even???  If pmlmeinfo->bcn_interval is zero
> > or one then the subtraction ends up giving us a negative.
> > 
> > regards,
> > dan carpenter
> > 
> 
> 1. pmlmeext->TSFValue can not be negative, because it is uint64_t;
> 2. pmlmeext->TSFValue is cyclic value:
>     https://en.wikipedia.org/wiki/Timing_synchronization_function ;
> 3. (rounddown(a, b)) is equal to (a - a % b) by definition.

Yeah.  You're right.  I got mixed up and I misread what you were
suggesting.

	tsf = rounddown(pmlmeext->TSFValue, pmlmeinfo->bcn_interval * 1024) - 1024;

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2020-04-14 13:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-12  7:17 [PATCH 1/8] staging: rtl8188eu: core: Replace function Set_MSR() Nishka Dasgupta
2019-07-12  7:17 ` [PATCH 2/8] staging: rtl8188eu: core: Remove function enable_rate_adaptive() Nishka Dasgupta
2019-07-12  7:17 ` [PATCH 3/8] staging: rtl8188eu: Replace function beacon_timing_control() Nishka Dasgupta
2019-07-12  7:17 ` [PATCH 4/8] staging: rtl8188eu: Remove function rtw_os_indicate_scan_done() Nishka Dasgupta
2019-07-12  7:17 ` [PATCH 5/8] staging: rtl8188eu: Remove function rtw_modular64() Nishka Dasgupta
2020-04-12 13:34   ` Ivan Safonov
2020-04-14 11:56     ` Dan Carpenter
2020-04-14 12:22       ` Ivan Safonov
2020-04-14 13:25         ` Dan Carpenter
2019-07-12  7:17 ` [PATCH 6/8] staging: rtl8188eu: Replace function rtw_alloc_network() Nishka Dasgupta
2019-07-12  7:17 ` [PATCH 7/8] staging: rtl8188eu: Replace function rtl88e_phy_rf6052_config() Nishka Dasgupta
2019-07-12  7:17 ` [PATCH 8/8] staging: rtl8188eu: Replace function rtl88eu_phy_rf_config() Nishka Dasgupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).