mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2024-11-25 23:15:00 +00:00
Remove wrapper around do_div
Wrapper routine rtw_modular64() contains only a call to do_div() and is used once in the code. Remove the wrapper. Link: https://lore.kernel.org/r/20210803135223.12543-9-Larry.Finger@lwfinger.net
This commit is contained in:
parent
d7c3737cd5
commit
4d3d23dd24
@ -2428,7 +2428,7 @@ void rtw_debug_rx_bcn(_adapter *adapter, u8 *pframe, u32 packet_len)
|
|||||||
|
|
||||||
update_TSF(pmlmeext, pframe, packet_len);
|
update_TSF(pmlmeext, pframe, packet_len);
|
||||||
tsf = pmlmeext->TSFValue;
|
tsf = pmlmeext->TSFValue;
|
||||||
tsf_offset = rtw_modular64(pmlmeext->TSFValue, (mlmeinfo->bcn_interval * 1024));
|
tsf_offset = do_div(pmlmeext->TSFValue, (mlmeinfo->bcn_interval * 1024));
|
||||||
|
|
||||||
/*get TIM IE*/
|
/*get TIM IE*/
|
||||||
/*DTIM Count*/
|
/*DTIM Count*/
|
||||||
|
@ -11328,7 +11328,7 @@ static void hw_var_set_correct_tsf(_adapter *adapter, u8 mlme_state)
|
|||||||
struct mlme_ext_priv *mlmeext = &adapter->mlmeextpriv;
|
struct mlme_ext_priv *mlmeext = &adapter->mlmeextpriv;
|
||||||
struct mlme_ext_info *mlmeinfo = &(mlmeext->mlmext_info);
|
struct mlme_ext_info *mlmeinfo = &(mlmeext->mlmext_info);
|
||||||
|
|
||||||
tsf = mlmeext->TSFValue - rtw_modular64(mlmeext->TSFValue, (mlmeinfo->bcn_interval * 1024)) - 1024; /*us*/
|
tsf = mlmeext->TSFValue - do_div(mlmeext->TSFValue, (mlmeinfo->bcn_interval * 1024)) - 1024; /*us*/
|
||||||
|
|
||||||
if ((mlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE
|
if ((mlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE
|
||||||
|| (mlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)
|
|| (mlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)
|
||||||
|
@ -753,11 +753,11 @@ static u8 rtw_hal_mcc_update_timing_parameters(PADAPTER padapter, u8 force_updat
|
|||||||
/* selecet policy table according TSF diff */
|
/* selecet policy table according TSF diff */
|
||||||
tsf0 = tsf[0];
|
tsf0 = tsf[0];
|
||||||
beaconperiod_0 = pmccobjpriv->iface[0]->mlmepriv.cur_network.network.Configuration.BeaconPeriod;
|
beaconperiod_0 = pmccobjpriv->iface[0]->mlmepriv.cur_network.network.Configuration.BeaconPeriod;
|
||||||
tsf0 = rtw_modular64(tsf0, (beaconperiod_0 * TU));
|
tsf0 = do_div(tsf0, (beaconperiod_0 * TU));
|
||||||
|
|
||||||
tsf1 = tsf[1];
|
tsf1 = tsf[1];
|
||||||
beaconperiod_1 = pmccobjpriv->iface[1]->mlmepriv.cur_network.network.Configuration.BeaconPeriod;
|
beaconperiod_1 = pmccobjpriv->iface[1]->mlmepriv.cur_network.network.Configuration.BeaconPeriod;
|
||||||
tsf1 = rtw_modular64(tsf1, (beaconperiod_1 * TU));
|
tsf1 = do_div(tsf1, (beaconperiod_1 * TU));
|
||||||
|
|
||||||
if (tsf0 > tsf1)
|
if (tsf0 > tsf1)
|
||||||
tsfdiff = tsf0- tsf1;
|
tsfdiff = tsf0- tsf1;
|
||||||
|
@ -622,7 +622,6 @@ extern void rtw_free_netdev(struct net_device *netdev);
|
|||||||
#endif /* PLATFORM_FREEBSD */
|
#endif /* PLATFORM_FREEBSD */
|
||||||
|
|
||||||
|
|
||||||
extern u64 rtw_modular64(u64 x, u64 y);
|
|
||||||
extern u64 rtw_division64(u64 x, u64 y);
|
extern u64 rtw_division64(u64 x, u64 y);
|
||||||
extern u32 rtw_random32(void);
|
extern u32 rtw_random32(void);
|
||||||
|
|
||||||
|
@ -2433,25 +2433,6 @@ void module_init_exit_wrapper(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif /* PLATFORM_FREEBSD */
|
#endif /* PLATFORM_FREEBSD */
|
||||||
|
|
||||||
#ifdef CONFIG_PLATFORM_SPRD
|
|
||||||
#ifdef do_div
|
|
||||||
#undef do_div
|
|
||||||
#endif
|
|
||||||
#include <asm-generic/div64.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
u64 rtw_modular64(u64 x, u64 y)
|
|
||||||
{
|
|
||||||
#ifdef PLATFORM_LINUX
|
|
||||||
return do_div(x, y);
|
|
||||||
#elif defined(PLATFORM_WINDOWS)
|
|
||||||
return x % y;
|
|
||||||
#elif defined(PLATFORM_FREEBSD)
|
|
||||||
return x % y;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
u64 rtw_division64(u64 x, u64 y)
|
u64 rtw_division64(u64 x, u64 y)
|
||||||
{
|
{
|
||||||
#ifdef PLATFORM_LINUX
|
#ifdef PLATFORM_LINUX
|
||||||
|
Loading…
Reference in New Issue
Block a user