summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-09-26staging: rtl8192e: fix CamelCase variablesValentin Vidic1-12/+12
Fix checkpatch warnings for variables: LinkCtrlReg, DeviceID, RevisionID, IrqLine. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr> Link: https://lore.kernel.org/r/20220925123810.2492865-1-vvidic@valentin-vidic.from.hr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-26staging: rtl8192e: Rename Tx_Retry_Count_RegDragan Cvetic2-11/+6
Rename: Current_Tx_Rate_Reg to CURRENT_TX_RATE_REG, Initial_Tx_Rate_Reg to INITIAL_TX_RATE_REG and Tx_Retry_Count_Reg to TX_RETRY_COUNT_REG to avoid CamelCase which is not accepted by checkpatch.pl. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Signed-off-by: Dragan Cvetic <dragan.m.cvetic@gmail.com> Link: https://lore.kernel.org/r/20220924225126.10527-1-dragan.m.cvetic@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: remove two unused enum entriesMartin Kaiser1-3/+0
Both LED_BLINK_StartToBlink and LED_BLINK_RUNTOP in enum LED_STATE_871x are not used in the r8188eu driver. Remove them. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220918175700.215170-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: remove duplicate bSurpriseRemoved checkMartin Kaiser1-1/+1
We don't have to check bSurpriseRemoved in the SwLedOn function. SwLedOn calls rtw_read8 which in turn calls usb_read. This function checks bSurpriseRemoved for us. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220918175700.215170-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: remove BlinkingLedStateMartin Kaiser2-62/+4
Both bLedOn and BlinkingLedState in struct led_priv store the same information. The boolean bLedOn stores the curent led state while BlinkingLedState stores the next led state to be set during blinking, which is the inverse of the current led state. (The led is either off or blinking, it's never continuously on.) This patch removes BlinkingLedState and uses bLedOn instead. The LED_BLINK_WPS_STOP case in blink_work checked for pLed->BlinkingLedState != RTW_LED_ON. This is true if the next led blinking state is ON, i.e. if the led has just been switched off by blink_work, i.e. if (!pLed->bLedOn). Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220918175700.215170-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: remove bLedNoLinkBlinkInProgressMartin Kaiser2-15/+0
Remove the bLedNoLinkBlinkInProgress state variable. Its sole purpose is to block subsequent requests for "no link" blinking when this blinking pattern is already active. It's perfectly safe to restart "no link" blinking. We can remove bLedNoLinkBlinkInProgress and the many places where it's updated. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220918175700.215170-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: update status before wps success blinkingMartin Kaiser1-14/+5
Always update the status variables in rtw_led_control when we start blinking to show that wps was successful. The if statements are not necessary. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220918175700.215170-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: cancel blink_work during wps stopMartin Kaiser1-15/+12
We can always cancel blink_work during wps_stop. The blinking pattern will be updated to show that wps was successful. Another worker will be started for this. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220918175700.215170-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: Fix return type of rtw_xmit_entryNathan Huckleberry2-3/+3
The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of rtw_xmit_entry should be changed from int to netdev_tx_t. Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Reported-by: Dan Carpenter <error27@gmail.com> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Nathan Huckleberry <nhuck@google.com> Link: https://lore.kernel.org/r/20220914211606.423959-1-nhuck@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: fix potential memory leak in _rtw_init_xmit_priv()Xiaoke Wang1-6/+24
In _rtw_init_xmit_priv(), there are several error paths for allocation failures just jump to the `exit` section. However, there is no action will be performed, so the allocated resources are not properly released, which leads to various memory leaks. To properly release them, this patch unifies the error handling code and several error handling paths are added. According to the allocation sequence, if the validation fails, it will jump to its corresponding error tag to release the resources. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com> Link: https://lore.kernel.org/r/tencent_DB57E4F270F4539485C32B05FDAF8394310A@qq.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: add kfree() on an error path of rtw_xmit_resource_alloc()Xiaoke Wang1-1/+3
In rtw_xmit_resource_alloc(), if usb_alloc_urb() fails, then the memory `pxmitbuf->pallocated_buf` which is allocated by kzalloc() is not properly released before returning. So this patch adds kfree() on the above error path to release it in time. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Reviewed-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com> Link: https://lore.kernel.org/r/tencent_3B46EE3287288555389AD2EC3F388827B306@qq.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: remove recv_osdep.hMichael Straube14-29/+6
The functions _rtw_init_recv_priv(), _rtw_free_recv_priv() and rtw_recv_entry() are defined in rtw_recv.c. Move their prototypes from recv_osdep.h to rtw_recv.h. Move the last two remaining prototypes netdev_open() and netdev_close() from recv_osdep.h to osdep_intf.h. That is a more appropriate place and we can remove recv_osdep.h. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220911174933.3784-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: remove unused prototypes from recv_osdep.hMichael Straube1-4/+0
The function prototypes rtw_recv_returnpacket(), rtw_init_recv_priv() and rtw_free_recv_priv() are not used. Remove them. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220911174933.3784-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: make _netdev_open() staticMichael Straube2-2/+1
The function _netdev_open() is only used in os_intfs.c. Make it static. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220911174933.3784-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: replace tabs with space in odm_query_rxpwrpercentage()Michael Straube1-2/+2
In statements spaces should be used not tabs. Replace tabs withs spaces in two return statements in odm_query_rxpwrpercentage(). Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220911161949.11293-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: clean up camel case in odm_query_rxpwrpercentage()Michael Straube1-4/+4
Rename the variable 'AntPower' in odm_query_rxpwrpercentage() to avoid camel case. AntPower -> antpower Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220911161949.11293-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: rename odm_QueryRxPwrPercentage()Michael Straube1-4/+4
Rename odm_QueryRxPwrPercentage() to avoid camel case. odm_QueryRxPwrPercentage -> odm_query_rxpwrpercentage Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220911161949.11293-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: remove unnecessary initializationMichael Straube1-1/+1
The variable 'retsig' in odm_signal_scale_mapping() is set in the function before it returns, so it is not needed to initialize it. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220911161949.11293-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: clean up camel case in odm_signal_scale_mapping()Michael Straube1-19/+19
Rename variables in odm_signal_scale_mapping() to avoid camel case. CurrSig -> currsig RetSig -> retsig Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220911161949.11293-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: rename odm_SignalScaleMapping()Michael Straube1-3/+3
Rename odm_SignalScaleMapping() to avoid camel case. odm_SignalScaleMapping -> odm_signal_scale_mapping Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220911161949.11293-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: update status before link blinkingMartin Kaiser1-5/+3
Always update the status variables in rtw_led_control when we start link blinking. The if statements are not necessary. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220911145122.15444-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: cancel blink_work before link blinkingMartin Kaiser1-6/+6
Cancel blink_work before we start link blinking. Another worker will be scheduled after the state variables are updated. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220911145122.15444-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: simplify the code to prevent link blinking restartMartin Kaiser1-18/+19
The blinking code to signal that a link is up has the same big if clause around it as most other blink events. Revert this if condition and exit if we're already blinking to show that the link is up. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220911145122.15444-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: update status before scan blinkingMartin Kaiser1-5/+3
Always update the status variables in rtw_led_control when we start tx/rx blinking. The if statements are not necessary. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220911145122.15444-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: cancel blink_work before tx/rx blinkingMartin Kaiser1-6/+6
Cancel blink_work before we start tx/rx blinking. Another worker will be scheduled after the state variables are updated. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220911145122.15444-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: simplify the code to prevent tx/rx blinking restartMartin Kaiser1-19/+20
The code for tx/rx blinking is wrapped into a big if clause to prevent restarting if tx/rx blinking is already running. Revert the if condition and exit if tx/rx blinking is running. This does not change the behaviour. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220911145122.15444-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: update status before scan blinkingMartin Kaiser1-9/+4
Always update the status variables in rtw_led_control when we start scan blinking. The if statements are not necessary. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220911145122.15444-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: cancel blink_work before scan blinkingMartin Kaiser1-9/+9
Cancel blink_work before we start scan blinking. Another worker will be scheduled after the state variables are updated. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220911145122.15444-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: simplify the code to prevent scan blinking restartMartin Kaiser1-23/+24
The code for scan blinking is wrapped into a big if clause to prevent restarting if scan blinking is already running. Revert the if condition and exit if scan blinking is running. This does not change the behaviour. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220911145122.15444-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: r8188eu: fix a potential memory leak in rtw_init_cmd_priv()Xiaoke Wang1-10/+5
In rtw_init_cmd_priv(), if `pcmdpriv->rsp_allocated_buf` is allocated in failure, then `pcmdpriv->cmd_allocated_buf` will not be properly released. Besides, considering there are only two error paths and the first one can directly return, we do not need to implicitly jump to the `exit` tag to execute the error handling code. So this patch added `kfree(pcmdpriv->cmd_allocated_buf);` on the error path to release the resource and simplified the return logic of rtw_init_cmd_priv(). As there is no proper device to test with, no runtime testing was performed. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com> Link: https://lore.kernel.org/r/tencent_1B6AAE10471D4556788892F8FF3E4812F306@qq.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: octeon: Fix return type of cvm_oct_xmit and cvm_oct_xmit_powNathan Huckleberry2-4/+4
The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of cvm_oct_xmit and cvm_oct_xmit_pow should be changed from int to netdev_tx_t. Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Reported-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nathan Huckleberry <nhuck@google.com> Link: https://lore.kernel.org/r/20220914211057.423617-1-nhuck@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: pi433: use DEFINE_SHOW_ATTRIBUTE to simplify pi433_debugfs_regsLiu Shixin1-14/+2
Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. No functional change. Signed-off-by: Liu Shixin <liushixin2@huawei.com> Link: https://lore.kernel.org/r/20220922142548.3248951-1-liushixin2@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8192u: Fix return type of ieee80211_xmitNathan Huckleberry2-4/+4
The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of ieee80211_xmit should be changed from int to netdev_tx_t. Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Reported-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Nathan Huckleberry <nhuck@google.com> Link: https://lore.kernel.org/r/20220914210750.423048-1-nhuck@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: vt6655: fix some erroneous memory clean-up loopsNam Cao1-3/+3
In some initialization functions of this driver, memory is allocated with 'i' acting as an index variable and increasing from 0. The commit in "Fixes" introduces some clean-up codes in case of allocation failure, which free memory in reverse order with 'i' decreasing to 0. However, there are some problems: - The case i=0 is left out. Thus memory is leaked. - In case memory allocation fails right from the start, the memory freeing loops will start with i=-1 and invalid memory locations will be accessed. One of these loops has been fixed in commit c8ff91535880 ("staging: vt6655: fix potential memory leak"). Fix the remaining erroneous loops. Link: https://lore.kernel.org/linux-staging/Yx9H1zSpxmNqx6Xc@kadam/ Fixes: 5341ee0adb17 ("staging: vt6655: check for memory allocation failures") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Signed-off-by: Nam Cao <namcaov@gmail.com> Link: https://lore.kernel.org/r/20220912170429.29852-1-namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8723bs: Add a blank line after declarationsKang Minchul1-0/+2
This patch adds a blank line in order to fix checkpatch warning Signed-off-by: Kang Minchul <tegongkang@gmail.com> Link: https://lore.kernel.org/r/20220922122310.3379711-5-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8723bs: Make switch and case at the same indentKang Minchul1-40/+40
This patch fixes switch and case as linux kernel coding style and amend this error generated by checkpatch: ERROR: switch and case should be at the same indent Signed-off-by: Kang Minchul <tegongkang@gmail.com> Link: https://lore.kernel.org/r/20220922122310.3379711-4-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8723bs: Relocate constant on the right side of testKang Minchul1-6/+6
This patch fixes following warning generated by checkpatch: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Kang Minchul <tegongkang@gmail.com> Link: https://lore.kernel.org/r/20220922122310.3379711-3-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8723bs: replace code indent as tabsKang Minchul1-6/+6
This patch removes error below generated by checkpatch ERROR: code indent should use tabs where possible Signed-off-by: Kang Minchul <tegongkang@gmail.com> Link: https://lore.kernel.org/r/20220922122310.3379711-2-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8723bs: Fix coding style issue in block commentKang Minchul1-16/+6
This patch removes the following warning generated by checkpatch.pl WARNING: Block comments use * on subsequent lines #206: FILE: rtw_recv.c:206: +/* +signed int rtw_enqueue_recvframe(union recv_frame *precvframe, struct __queue *queue) WARNING: Block comments use * on subsequent lines #216: FILE: rtw_recv.c:216: +/* +caller : defrag ; recvframe_chk_defrag in recv_thread (passive) Signed-off-by: Kang Minchul <tegongkang@gmail.com> Link: https://lore.kernel.org/r/20220919133408.3271462-1-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8723bs: Insert blank line after declarationsKang Minchul1-0/+6
This patch fixes checkpatch warning as follows: WARNING: Missing a blank line after declarations Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kang Minchul <tegongkang@gmail.com> Link: https://lore.kernel.org/r/20220917181620.3237192-1-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8723bs: remove braces in single statement blocksKang Minchul1-11/+5
This commit cleans up checkpatch warning as follows: WARNING: braces {} are not necessary for single statement blocks Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kang Minchul <tegongkang@gmail.com> Link: https://lore.kernel.org/r/20220913162510.3134430-1-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv()Xiaoke Wang1-10/+6
In rtw_init_cmd_priv(), if `pcmdpriv->rsp_allocated_buf` is allocated in failure, then `pcmdpriv->cmd_allocated_buf` will be not properly released. Besides, considering there are only two error paths and the first one can directly return, so we do not need implicitly jump to the `exit` tag to execute the error handler. So this patch added `kfree(pcmdpriv->cmd_allocated_buf);` on the error path to release the resource and simplified the return logic of rtw_init_cmd_priv(). As there is no proper device to test with, no runtime testing was performed. Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com> Link: https://lore.kernel.org/r/tencent_2B7931B79BA38E22205C5A09EFDF11E48805@qq.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8723bs: fix potential memory leak in rtw_init_drv_sw()Xiaoke Wang1-29/+31
In rtw_init_drv_sw(), there are various init functions are called to populate the padapter structure and some checks for their return value. However, except for the first one error path, the other five error paths do not properly release the previous allocated resources, which leads to various memory leaks. This patch fixes them and keeps the success and error separate. Note that these changes keep the form of `rtw_init_drv_sw()` in "drivers/staging/r8188eu/os_dep/os_intfs.c". As there is no proper device to test with, no runtime testing was performed. Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com> Link: https://lore.kernel.org/r/tencent_C3B899D2FC3F1BC827F3552E0B0734056006@qq.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8192e: Remove ftrace-like logging in rtl819x_BAProc.c, ...Philipp Hortmann4-25/+0
Remove "Unnecessary ftrace-like logging" as requested by checkpatch. Remove multiline macro as it is not needed anymore and not liked by kernel community. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/2c41e6856cd37b4f3e5cb1108272bcc24032bf64.1663387785.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8192e: Remove ftrace-like logging in rtl_ps.cPhilipp Hortmann1-34/+0
Remove "Unnecessary ftrace-like logging" as requested by checkpatch. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/6d942ba65f62643af2ff7104911f7947cca21790.1663387785.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8192e: Remove ftrace-like logging in rtl_dm.cPhilipp Hortmann1-165/+0
Remove "Unnecessary ftrace-like logging" as requested by checkpatch. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/bc0e2c9551ccf78fe388b27d18576b5bb195e2f7.1663387785.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8192e: Remove ftrace-like logging in r8192E_phy.cPhilipp Hortmann1-132/+0
Remove "Unnecessary ftrace-like logging" as requested by checkpatch. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/7315b22f54d62c5b56e8b9284426eca4cb641f77.1663387785.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8192e: Remove ftrace-like logging in r8192E_dev.cPhilipp Hortmann1-160/+1
Remove "Unnecessary ftrace-like logging" as requested by checkpatch. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/425e1b015c34ddb6df425bc516df64c40a70a58a.1663387785.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: rtl8192e: Remove ftrace-like logging in r8192E_firmware.c, ...Philipp Hortmann7-42/+0
Remove "Unnecessary ftrace-like logging" as requested by checkpatch. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/370f47919a69f2f1717f50123c1617cabc78ceca.1663387785.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24staging: fwserial: Switch to kfree_rcu() APIShang XiaoJing1-2/+1
Instead of invoking a synchronize_rcu() to free a pointer after a grace period, we can directly make use of a new API that does the same but in a more efficient way. Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com> Link: https://lore.kernel.org/r/20220920135145.1387-1-shangxiaojing@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>