rtl8723bs: improve readability in cmd filter and traffic watchdog
PATCH 1/1 rtl8723bs: improve readability in cmd filter and traffic watchdog
- Rename bAllow to allow_pre_init_cmd
- Convert traffic flags to bool where appropriate
- Improve comments for traffic detection logic
No functional change.
--- drivers/staging/rtl8723bs/core/rtw_cmd.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +13 -8
@@ -298,12 +298,13 @@ void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)int rtw_cmd_filter (struct cmd_priv *pcmdpriv,struct cmd_obj *cmd_obj);int rtw_cmd_filter (struct cmd_priv *pcmdpriv,struct cmd_obj *cmd_obj) { -u8 bAllow = false;/* set to true to allow enqueuing cmd when hw_init_completed is false */ +/* set to true to allow enqueuing cmd when hw_init_completed is false */ +bool allow_pre_init_cmd = false;if (cmd_obj->cmdcode ==GEN_CMD_CODE (_SetChannelPlan)) - bAllow = true; + allow_pre_init_cmd = true; -if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) || +if ((!pcmdpriv->padapter->hw_init_completed && !allow_pre_init_cmd) || !atomic_read (&pcmdpriv->cmdthd_running))/* com_thread not running */ return _FAIL;
@@ -1127,12 +1128,16 @@ static void collect_traffic_statistics(struct adapter *padapter)u8 traffic_status_watchdog (struct adapter *padapter,u8 from_timer) { -u8 bEnterPS = false; +bool bEnterPS = false;u16 BusyThresholdHigh =25 ;u16 BusyThresholdLow =10 ;u16 BusyThreshold = BusyThresholdHigh; -u8 bBusyTraffic = false, bTxBusyTraffic = false, bRxBusyTraffic = false; -u8 bHigherBusyTraffic = false, bHigherBusyRxTraffic = false, bHigherBusyTxTraffic = false; +u8 bBusyTraffic = false; +u8 bTxBusyTraffic = false; +u8 bRxBusyTraffic = false; +u8 bHigherBusyTraffic = false; +u8 bHigherBusyRxTraffic = false; +u8 bHigherBusyTxTraffic = false;struct mlme_priv *pmlmepriv = &padapter->mlmepriv;collect_traffic_statistics (padapter);
@@ -1156,7 +1161,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer) bTxBusyTraffic = true; } -/* Higher Tx/Rx data. */ +/* Detect high Tx/Rx traffic load. */ if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod >4000 || pmlmepriv->LinkDetectInfo.NumTxOkInPeriod >4000 ) { bHigherBusyTraffic = true;
@@ -1191,7 +1196,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer) bEnterPS = true; } -/* LeisurePS only work in infra mode. */ +/* LeisurePS based on traffic state (infra mode only) */ if (bEnterPS) {if (!from_timer)LPS_Enter (padapter,"TRAFFIC_IDLE" );
Signature · 1 line
2.47.3
Quoted 74 lines · Vasilije Knezevic
- Rename bAllow to
allow_pre_init_cmd
- Convert traffic flags to bool where appropriate
- Improve comments for traffic detection logicNo functional change.
Signed-off-by Vasilije Knezevic <[email protected]>--- drivers/staging/rtl8723bs/core/rtw_cmd.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)drivers/staging/rtl8723bs/core/rtw_cmd.c +13
-8@@ -298,12 +298,13 @@ void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)int rtw_cmd_filter (struct cmd_priv *pcmdpriv,struct cmd_obj *cmd_obj);int rtw_cmd_filter (struct cmd_priv *pcmdpriv,struct cmd_obj *cmd_obj) { -u8 bAllow = false;/* set to true to allow enqueuing cmd when hw_init_completed is false */ +/* set to true to allow enqueuing cmd when hw_init_completed is false */ +bool allow_pre_init_cmd = false;if (cmd_obj->cmdcode ==GEN_CMD_CODE (_SetChannelPlan)) - bAllow = true; + allow_pre_init_cmd = true; -if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) || +if ((!pcmdpriv->padapter->hw_init_completed && !allow_pre_init_cmd) || !atomic_read (&pcmdpriv->cmdthd_running))/* com_thread not running */ return _FAIL;@@ -1127,12 +1128,16 @@ static void collect_traffic_statistics(struct adapter *padapter)u8 traffic_status_watchdog (struct adapter *padapter,u8 from_timer) { -u8 bEnterPS = false; +bool bEnterPS = false;u16 BusyThresholdHigh =25 ;u16 BusyThresholdLow =10 ;u16 BusyThreshold = BusyThresholdHigh; -u8 bBusyTraffic = false, bTxBusyTraffic = false, bRxBusyTraffic = false; -u8 bHigherBusyTraffic = false, bHigherBusyRxTraffic = false, bHigherBusyTxTraffic = false; +u8 bBusyTraffic = false; +u8 bTxBusyTraffic = false; +u8 bRxBusyTraffic = false; +u8 bHigherBusyTraffic = false; +u8 bHigherBusyRxTraffic = false; +u8 bHigherBusyTxTraffic = false;struct mlme_priv *pmlmepriv = &padapter->mlmepriv;collect_traffic_statistics (padapter);@@ -1156,7 +1161,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer) bTxBusyTraffic = true; } -/* Higher Tx/Rx data. */ +/* Detect high Tx/Rx traffic load. */ if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod >4000 || pmlmepriv->LinkDetectInfo.NumTxOkInPeriod >4000 ) { bHigherBusyTraffic = true;@@ -1191,7 +1196,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer) bEnterPS = true; } -/* LeisurePS only work in infra mode. */ +/* LeisurePS based on traffic state (infra mode only) */ if (bEnterPS) {if (!from_timer)LPS_Enter (padapter,"TRAFFIC_IDLE" );Signature · 1 line
2.47.3
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.
You are receiving this message because of the following common error(s) as indicated below:
- Your patch did many different things all at once, making it difficult to review. All Linux kernel patches need to only do one thing at a time. If you need to do multiple things (such as clean up all coding style issues in a file/driver), do it in a sequence of patches, each one doing only one thing. This will make it easier to review the patches to ensure that they are correct, and to help alleviate any merge issues that larger patches can cause.
If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.
thanks,
greg k-h's patch email bot