aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/r8188eu/core/rtw_pwrctrl.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-08-30staging: r8188eu: use time_after_eq(a,b) to replace "a>=b"Yu Zhe1-1/+1
time_after_eq() deals with timer wrapping correctly. Signed-off-by: Yu Zhe <yuzhe@nfschina.com> Link: https://lore.kernel.org/r/20220826020151.10138-1-yuzhe@nfschina.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-31staging: r8188eu: fix potential uninitialised variable use in rtw_pwrctrl.cPhillip Potter1-3/+3
Set ret to 0 (success) before entering first if statement, thereby assuring that even if the device is not associated and further checks pass, we do not then end up returning the uninitialized value of ret. This assignment is deliberately now directly before the if statement, in order to keep it clear what is happening as opposed to having it as an initialization at the start of the function like it was originally. Also add a comment to make it clear this first if block is currently a success path. As a side note, smatch does not trigger warnings for this change, for me at least. Within core/rtw_pwrctrl.c in the rtw_pwr_wakeup function, I previously dropped the initialization of 'ret' (int ret = 0;) in favour of its assignment which happens inside the first if block directly before its corresponding goto. This was the cause of this bug, and was introduced by: commit f3a76018dd55 ("staging: r8188eu: remove initializer from ret in rtw_pwr_wakeup"). Fixes: f3a76018dd55 ("staging: r8188eu: remove initializer from ret in rtw_pwr_wakeup") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20220730235910.1145-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-29staging: r8188eu: remove initializer from ret in rtw_pwr_wakeupPhillip Potter1-1/+1
Remove the success initializer from the ret variable in rtw_pwr_wakeup, as we set it later anyway in the success path, and also set on failure. This makes the function appear cleaner and more consistent. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20220728231150.972-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-27staging: r8188eu: convert rtw_pwr_wakeup to correct error code semanticsPhillip Potter1-5/+5
Convert the rtw_pwr_wakeup function to use 0 on success and an appropriate error code on error. For the first failure block where ips_leave is invoked, use -ENOMEM as this is the main cause of failure here anyway. For the second failure block, use -EBUSY, as it seems the most appropriate. Finally, within the functions rtw_wx_set_mode, rtw_wx_set_wap, rtw_wx_set_scan and rtw_wx_set_essid, pass the error code on from rtw_pwr_wakeup as appropriate now that it is converted. This gets the driver closer to removal of the non-standard _SUCCESS and _FAIL definitions, which are inverted compared to the standard in-kernel error code mechanism. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20220725220745.12739-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-27staging: r8188eu: remove rtw_usleep_osMartin Kaiser1-1/+1
Remove the rtw_usleep_os helper function. There are only two callers, both of which call rtw_usleep_os(100). This is equivalent to msleep(1). Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Tested-by: Pavel Skripkin <paskripkin@gmail.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220626180603.287054-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-10staging: r8188eu: add error handling of rtw_read32Pavel Skripkin1-1/+8
rtw_read32() reads data from device via USB API which may fail. In case of any failure previous code returned stack data to callers, which is wrong. Fix it by changing rtw_read32() prototype and prevent caller from touching random stack data Signed-off-by: Pavel Skripkin <paskripkin@gmail.com> Link: https://lore.kernel.org/r/583c3d21c46066275e4fc8da5ba4fd0e3679335b.1654629778.git.paskripkin@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-19staging: r8188eu: fix warnings in rtw_pwrctrlVihas Makwana1-6/+6
Refactor the code to fix following warnings: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Vihas Makwana <makvihas@gmail.com> Link: https://lore.kernel.org/r/20220517140626.3716-3-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-14staging: r8188eu: remove the bInSuspend loopMartin Kaiser1-4/+0
Remove the loop in rtw_pwr_wakeup that waits while the system is suspended. pwrpriv->bInSuspend is set in rtw_suspend and cleared in rtw_resume. These functions are the .suspend and .resume functions of the struct usb_driver for r8188eu. A usb_driver's suspend and resume functions are called when the entire system goes into suspend or runtime suspend. All of the code paths for rtw_pwr_wakeup start at ioctl handlers. We can remove the loop that checks bInSuspend. It's not possible to call an ioctl while the entire system is suspended. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-14staging: r8188eu: clean up the code to set ips_deny_timeMartin Kaiser1-9/+4
Clean up the code in rtw_pwr_wakeup that sets pwrpriv->ips_deny_time. Make ips_deny_time an unsigned long, this type is used by the kernel functions that process jiffies. Remove the temporary variable ips_deffer_ms and use RTW_PWR_STATE_CHK_INTERVAL directly. There's no need to set ips_deny_time twice, it's sufficient to set it at the end of rtw_pwr_wakeup. Use time_before to check if ips_deny_time should be updated. We can now remove rtw_ms_to_systime, this function is not used any more. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-14staging: r8188eu: use kernel functions for timeout handlingMartin Kaiser1-3/+3
Use the kernel functions to set a timeout and to check if it's expired. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-14staging: r8188eu: summarize two if statementsMartin Kaiser1-5/+4
Summarize two if statements in rtw_pwr_wakeup and place the constants on the right side of the comparison. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-14staging: r8188eu: simplify the ps_processing checkMartin Kaiser1-4/+2
It's sufficient to check pwrpriv->ps_processing as part of the while-loop. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-14staging: r8188eu: make return values consistentMartin Kaiser1-4/+2
rtw_pwr_wakeup should return _SUCCESS or _FAIL. Replace false with _FAIL in one place and reformat the if-statement. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-14staging: r8188eu: simplify delay conditions in rtw_pwr_wakeupMartin Kaiser1-6/+2
Simplify the conditions for a loop in rtw_pwr_wakeup that waits while the system is suspended. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-12staging: r8188eu: improve timeout handling in LPS_RF_ON_checkMartin Kaiser1-3/+2
Use the standard kernel functions to define and check the timeout in LPS_RF_ON_check. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220409163212.241122-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-12staging: r8188eu: make LPS_RF_ON_check staticMartin Kaiser1-1/+1
LPS_RF_ON_check is used only in rtw_pwrctrl.c. Make it a static function. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220409163212.241122-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-12staging: r8188eu: remove HW_VAR_H2C_FW_PWRMODEMichael Straube1-4/+15
Remove the HW_VAR_H2C_FW_PWRMODE case from SetHwReg8188EU() and move its functionality to a new function in rtw_pwrctrl.c. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220409120627.10633-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: r8188eu: remove unncessary ternary operatorMichael Straube1-2/+2
There are some uses of ternary operator where it explicitly sets true or false but the condition already evaluates to true or false. In this cases the ternary operator is redundant and can be removed. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220405060813.8448-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: pwr_state_check_cnts is always zeroMichael Straube1-3/+1
The field pwr_state_check_cnts in struct pwrctrl_priv is set to 0 and never changed. Remove it and remove related dead code. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220404082142.4639-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: clean up comment for rtw_pwr_wakeup()Michael Straube1-6/+1
Clean up the comment for rtw_pwr_wakeup() by removing obvious information. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220403103713.12883-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: remove macro rtw_pwr_wakeup()Michael Straube1-1/+1
After previous cleanups the rtw_pwr_wakeup() macro is just an alias for _rtw_pwr_wakeup(). Remove the macro and rename _rtw_pwr_wakeup() to rtw_pwr_wakeup(). Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220403103713.12883-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: remove constant parameter from _rtw_pwr_wakeup()Michael Straube1-2/+5
The parameter 'ips_deffer_ms' of _rtw_pwr_wakeup() is always RTW_PWR_STATE_CHK_INTERVAL. Make it local. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220403103713.12883-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: remove unused parameter from _rtw_pwr_wakeup()Michael Straube1-1/+1
The parameter 'caller' of _rtw_pwr_wakeup() is not used. Remove it. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220403103713.12883-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: remove HW_VAR_FWLPS_RF_ON from GetHwReg8188EU()Michael Straube1-3/+16
Move the functionality of the HW_VAR_FWLPS_RF_ON case in GetHwReg8188EU() to a static function in rtw_pwrctrl.c and remove the HW_VAR_FWLPS_RF_ON case from GetHwReg8188EU(). This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220331130522.6648-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-14staging: r8188eu: mark PS_RDY_CHECK as boolVihas Makwana1-1/+1
Mark PS_RDY_CHECK as bool as it returns true/false. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Vihas Makwana <makvihas@gmail.com> Link: https://lore.kernel.org/r/20220302204737.49056-5-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-17staging: r8188eu: correct long line warnings near prior DBG_88E callsPhillip Potter1-1/+2
Where it is possible (without out-of-patch-series-scope large scale refactoring), correct code to remove checkpatch warnings about lines that are too long, also correcting operator spacing where appropriate for these lines as well. These warnings occur mostly due to so many DBG_88E removals and parentheses tweaks etc. being adjacent to such long lines, which are therefore included in the resultant diff. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20220216010709.791-16-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-17staging: r8188eu: fix lines modified by DBG_88E cleanupPhillip Potter1-12/+2
A number of style problems were left behind by the DBG_88E cleanup: (1) Empty if/else blocks. (2) Parenthesised if/while statements containing only one line. (3) Entire blocks which server zero purpose after removal of DBG_88E. (4) Various warnings about whitespace, and constant comparison order. (5) Use of __constant_htons instead when htons should be used. Fix up these issues across the driver in any file touched by the previous cleanup. Long line warnings will be addresses in a later patch. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20220216010709.791-13-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-17staging: r8188eu: remove DBG_88E calls from core subdirPhillip Potter1-26/+4
Remove all remaining DBG_88E calls from the core subdirectory. After some thought, it makes more sense to just entirely strip all of these calls, so that debugging code in the driver can be more consistent and useful going forwards. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20220216010709.791-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-17staging: r8188eu: remove previously converted DBG_88E_LEVEL callsPhillip Potter1-8/+0
Remove all netdev_dbg and dev_dbg calls that were previously converted from DBG_88E_LEVEL. After some thought, it makes more sense to just entirely strip all of these calls, so that debugging code in the driver can be more consistent and useful going forwards. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20220216010709.791-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-03staging: r8188eu: internal autosuspend is always falseMartin Kaiser1-8/+1
bInternalAutoSuspend is always false. Remove the variable and related checks. Acked-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220102175932.89127-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-03staging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_pwrctrl.cPhillip Potter1-5/+8
Convert all DBG_88E_LEVEL macro calls in core/rtw_pwrctrl.c to plain netdev_dbg calls, as although the information is potentially useful, we should be exposing it using standard kernel debugging functionality. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20211129002041.865-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-24staging: r8188eu: Use a Mutex instead of a binary SemaphoreFabio M. De Francesco1-5/+5
Use a Mutex instead of a binary Semaphore for the purpose of enforcing mutual exclusive access to the "pwrctrl_priv" structure. Mutexes are sleeping locks similar to Semaphores with a 'count' of one (like binary Semaphores), however they have a simpler interface, more efficient performance, and additional constraints. There is no change in the logic of the new code; however it is more simple because it gets rid of four unnecessary wrappers: _init_pwrlock(), _enter_pwrlock(),_exit_pwrlock(), _rtw_down_sema(). Actually, there is a change in the state in which the code waits for acquiring locks, because it makes it in an uninterruptible state (instead the old code used down_interruptibe()). Interruptible waits are neither required nor wanted in this driver. Tested with ASUSTek Computer, Inc. Realtek 8188EUS [USB-N10 Nano]. Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20211022171917.24363-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-10staging: r8188eu: remove GetHwRegHandler from hal_opsMichael Straube1-1/+1
Remove GetHwRegHandler from struct hal_ops and remove the wrapper rtw_hal_get_hwreg(). Call GetHwReg8188EU() directly instead. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211007103943.8433-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-10staging: r8188eu: remove SetHwRegHandler from hal_opsMichael Straube1-2/+2
Remove SetHwRegHandler from struct hal_ops and remove the wrapper rtw_hal_set_hwreg(). Call SetHwReg8188EU() directly instead. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211007103943.8433-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-20staging: r8188eu: Remove mp, a.k.a. manufacturing process, codeLarry Finger1-7/+1
The standard driver contains code used by the factory to evaluate chips that have just been manufactured. Such code is indicated by "mp" in the variable names, the routine names, and in file names. All of these can be deleted. In addition to removing nearly 7,000 lines of code, the size of the driver is reduced by 63 KB: text data bss dec hex Before 573959 48582 14660 637201 9b911 After 513530 45894 14660 574084 8c284 Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20210920185437.15652-1-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-14staging: r8188eu: rtw_set_ips_deny is not usedMartin Kaiser1-6/+0
Remove the rtw_set_ips_deny function since it's not used. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210913185110.3065-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-14staging: r8188eu: _free_pwrlock is emptyMartin Kaiser1-8/+0
Remove the empty _free_pwrlock function and rtw_free_pwrctrl_priv, which is just a wrapper around _free_pwrlock. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210913185110.3065-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-14staging: r8188eu: remove rtw_set_rpwmMartin Kaiser1-34/+0
After we dropped the call to set HW_VAR_SET_RPWM, the rtw_set_rpwm function doesn't do anything useful. Remove the function and the rpwm component of struct pwrctrl_priv, which is not used outside of rtw_set_rpwm. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210913185110.3065-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-13staging: r8188eu: bHWPwrPindetect is always falseMartin Kaiser1-20/+0
The bHWPwrPindetect component of struct pwrctrl_priv is never initialised explicitly, it remains at its default value 0. Remove bHWPwrPindetect itself and code that depends on bHWPwrPindetect != 0. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210911161019.26881-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-13staging: r8188eu: remove write-only variable togMartin Kaiser1-4/+0
tog in struct pwrctrl_priv is never read. Remove it. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210911141521.24901-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-13staging: r8188eu: remove write-only variable cpwmMartin Kaiser1-5/+0
cpwm in struct pwrctrl_priv is never read. Remove it. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210911141521.24901-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-13staging: r8188eu: setting HW_VAR_SET_RPWM does nothingMartin Kaiser1-5/+0
Setting the HW_VAR_SET_RPWM "hardware variable" is an empty operation. Remove the call to set HW_VAR_SET_RPWM, the calculation of the value to be set and the definition of HW_VAR_SET_RPWM itself. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210911141521.24901-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-13staging: r8188eu: btcoex_rfon is always falseMartin Kaiser1-7/+0
btcoex_rfon is always false in this driver. Remove the variable and code that will never be executed. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210911141521.24901-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-13staging: r8188eu: Remove conditionals CONFIG_88EU_{AP_MODE,P2P}Larry Finger1-19/+0
These rwo conditional compile symbols are explicitely defined. As a result, their included code is always compiled. They could be converted to Kconfig symbols; however, my experience with this driver in a GitHub repo is that many users of the device have it built into a SOC or SBC that they wish to use as an access point. As a result, CONFIG_88EU_APMODE would need to be selected. Thuse it should be built in. There have also been many users the wish to establish peer-to-peer networks with this device. For this reason, I am also proposing that CONFIG_88EU_P2P be automatically included. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20210909165809.12634-1-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-13staging: r8188eu: remove unused function rtw_interface_ps_func()Michael Straube1-8/+0
Remove unused function rtw_interface_ps_func(). Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210906190223.11396-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-18staging: r8188eu: clean up comparsions to falseMichael Straube1-7/+7
Clean up comparsions to false. x == false -> !x Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210818080854.15847-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-17staging: r8188eu: clean up spacing style issues in core/rtw_pwrctrl.cMichael Straube1-8/+8
Clean up spacing style issues in core/rtw_pwrctrl.c reported by checkpatch. CHECK: spaces preferred around that ... WARNING: space prohibited before semicolon Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210816155818.24005-16-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-10staging: r8188eu: remove unnecessary parentheses in core/rtw_pwrctrl.cMichael Straube1-10/+10
Remove unnecessary parentheses in core/rtw_pwrctrl.c reported by checkpatch. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210809165007.23204-14-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: Remove wrapper routine rtw_msleep_os()Larry Finger1-2/+2
The effect of this macro is to call msleep(). Remove the wrapper. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20210805192644.15978-2-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: Remove unnecessary parenthesesNathan Chancellor1-1/+1
Clang warns several times across the driver along the lines of: drivers/staging/r8188eu/core/rtw_pwrctrl.c:222:21: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((pwrpriv->rpwm == pslv)) { ~~~~~~~~~~~~~~^~~~~~~ drivers/staging/r8188eu/core/rtw_pwrctrl.c:222:21: note: remove extraneous parentheses around the comparison to silence this warning if ((pwrpriv->rpwm == pslv)) { ~ ^ ~ drivers/staging/r8188eu/core/rtw_pwrctrl.c:222:21: note: use '=' to turn this equality comparison into an assignment if ((pwrpriv->rpwm == pslv)) { ^~ = 1 warning generated. The compilers have agreed that single parentheses are used for equality and double parentheses are used for assignment within control flow statements such as if and while so remove them in these places to fix the warning. Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20210805185807.3296077-2-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>