summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192u
AgeCommit message (Collapse)Author
2021-12-20staging: rtl8192u: remove some repeated words in some commentsJason Wang
The double `new' in the comment in line 1349 and `to' in the comment in line 2030 are repeated. Remove the repeated words from these comments. Signed-off-by: Jason Wang <wangborong@cdjrlc.com> Link: https://lore.kernel.org/r/20211211091422.260442-1-wangborong@cdjrlc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-03staging: rtl8192u: make array queuetopipe static constColin Ian King
Don't populate the array queuetopipe on the stack but instead make it static const. Also makes the object code smaller by ~50 bytes. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20211129225013.524016-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-15staging: rtl8192u: remove the if condition without effectSaurav Girepunje
In function rtl8192_adapter_start priv->pFirmware->firmware_status is assign to FW_STATUS_0_INIT just after assignment variable is again get check for same value. Therefore if condition will be always be true. So remove the if condition ,else if section and else section which will never get execute. Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com> Link: https://lore.kernel.org/r/YYijapuGOmObwM3S@Sauravs-MacBook-Air.local Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-26staging: rtl8192u: fix control-message timeoutsJohan Hovold
USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging") Cc: stable@vger.kernel.org # 2.6.33 Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20211025120910.6339-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20staging: rtl: use eth_hw_addr_set()Jakub Kicinski
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20211019171243.1412240-8-kuba@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20staging: use eth_hw_addr_set() instead of ether_addr_copy()Jakub Kicinski
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers. Convert staging from ether_addr_copy() to eth_hw_addr_set(): @@ expression dev, np; @@ - ether_addr_copy(dev->dev_addr, np) + eth_hw_addr_set(dev, np) Signed-off-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20211019171243.1412240-3-kuba@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20staging: use eth_hw_addr_set()Jakub Kicinski
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers. Convert staging drivers from memcpy(... ETH_ADDR) to eth_hw_addr_set(): @@ expression dev, np; @@ - memcpy(dev->dev_addr, np, ETH_ALEN) + eth_hw_addr_set(dev, np) @@ - memcpy(dev->dev_addr, np, 6) + eth_hw_addr_set(dev, np) Signed-off-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20211019171243.1412240-2-kuba@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-05staging: rtl8192u: remove unused static variableSaurav Girepunje
remove unused static variable channels. Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com> Link: https://lore.kernel.org/r/YVjN9FT4KjLGX/Zg@user Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26staging/rtl8192u: Prefer kcalloc over open coded arithmeticLen Baker
As noted in the "Deprecated Interfaces, Language Features, Attributes, and Conventions" documentation [1], size calculations (especially multiplication) should not be performed in memory allocator (or similar) function arguments due to the risk of them overflowing. This could lead to values wrapping around and a smaller allocation being made than the caller was expecting. Using those allocations could lead to linear overflows of heap memory and other misbehaviors. In this case these aren't actually dynamic sizes: both sides of the multiplication are constant values. However it is best to refactor these anyway, just to keep the open-coded math idiom out of code. So, use the purpose specific kcalloc() function instead of the argument size * count in the kzalloc() function. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Len Baker <len.baker@gmx.com> Link: https://lore.kernel.org/r/20210824090039.GA7999@titan Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26staging/rtl8192u: Initialize variables in the definition blockLen Baker
Initialize the pre_cmd_cnt, post_cmd_cnt and rf_cmd_cnt variables in the definition block as it is not necessary to do this in the middle of the function. Signed-off-by: Len Baker <len.baker@gmx.com> Link: https://lore.kernel.org/r/20210824073643.GA7396@titan Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26staging/rtl8192u: Avoid CamelCase in names of variablesLen Baker
Avoid CameCase in the names of all local variables inside the function rtl8192_phy_SwChnlStepByStep(). Signed-off-by: Len Baker <len.baker@gmx.com> Link: https://lore.kernel.org/r/20210824072545.7321-2-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-16staging: rtl8192u: Fix bitwise vs logical operator in ↵Nathan Chancellor
TranslateRxSignalStuff819xUsb() clang warns: drivers/staging/rtl8192u/r8192U_core.c:4268:20: warning: bitwise and of boolean expressions; did you mean logical and? [-Wbool-operation-and] bpacket_toself = bpacket_match_bssid & ^~~~~~~~~~~~~~~~~~~~~ && 1 warning generated. Replace the bitwise AND with a logical one to clear up the warning, as that is clearly what was intended. Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20210814235625.1780033-1-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-10staging: rtl8192u: Avoid field-overflowing memcpy()Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Split the 3 addr memcpy() into 3 memcpy() calls so the compiler doesn't think an overflowing memcpy() happens against the addr1 field (the neighbors are intended to be copied as well). ieee80211_read_qos_param_element() copies a struct ieee80211_info_element into a struct ieee80211_qos_information_element, but is actually wanting to copy into the larger struct ieee80211_qos_parameter_info (the contents of ac_params_record[] is later examined). Refactor the routine to perform centralized checks, and copy the entire contents directly (since the id and len members match the elementID and length members): struct ieee80211_info_element { u8 id; u8 len; u8 data[]; } __packed; struct ieee80211_qos_information_element { u8 elementID; u8 length; u8 qui[QOS_OUI_LEN]; u8 qui_type; u8 qui_subtype; u8 version; u8 ac_info; } __packed; struct ieee80211_qos_parameter_info { struct ieee80211_qos_information_element info_element; u8 reserved; struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; } __packed; Additionally replace old-style zero-element arrays with flexible arrays. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Pascal Terjan <pterjan@google.com> Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Cc: devel@driverdev.osuosl.org Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20210806201208.2871467-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-27staging/rtl8192u: Remove all strcpy() uses in favor of strscpy()Len Baker
strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy(). Signed-off-by: Len Baker <len.baker@gmx.com> Link: https://lore.kernel.org/r/20210718113207.10045-1-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-03staging: rtl8192u: fix spaces in r8192U_hw.hManikishan Ghantasala
Fixed "please, no space before tabs" checkpatch warning. Signed-off-by: Manikishan Ghantasala <manikishanghantasala@gmail.com> Link: https://lore.kernel.org/r/20210602193334.11687-4-manikishanghantasala@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-03staging: rtl8192u: put parentheses on macros with complex values in r8192U_hw.hManikishan Ghantasala
Fix "Macros with complex values should be enclosed in parentheses" checkpatch error. Signed-off-by: Manikishan Ghantasala <manikishanghantasala@gmail.com> Link: https://lore.kernel.org/r/20210602193334.11687-3-manikishanghantasala@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-03staging: rtl8192u: r8192U_hw.h: fix spaces preferred around that '|' code ↵Manikishan Ghantasala
style error Fix "spaces preferred around that '|' " checkpatch CHECK. Signed-off-by: Manikishan Ghantasala <manikishanghantasala@gmail.com> Link: https://lore.kernel.org/r/20210602193334.11687-2-manikishanghantasala@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-03staging: rtl8192u: remove the repeated declarationShaokun Zhang
Functions 'ieee80211_stop_send_beacons' and 'notify_wx_assoc_event' are declared twice in their header file, so remove the repeated declaration. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com> Link: https://lore.kernel.org/r/1622446678-52652-1-git-send-email-zhangshaokun@hisilicon.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-03staging: rtl8192u: Fix shadowed variable nameThomas Bracht Laumann Jespersen
Fixes the following sparse warning: drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c:798:32: warning: symbol 'tcb_desc' shadows an earlier one drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c:550:24: originally declared here Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz> Link: https://lore.kernel.org/r/20210527192149.29686-1-t@laumann.xyz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-27staging: rtl8192u: Fixed warnings of coding stylePiyush Thange
Fixed coding style issues with comments. Signed-off-by: Piyush Thange <pthange19@gmail.com> Link: https://lore.kernel.org/r/20210526172900.56093-1-pthange19@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-19staging: rtl8192u: Fix variable shadowing warningCláudio Maia
Fixes the following sparse warnings: drivers/staging/rtl8192u/r8192U_core.c:2306:21: warning: symbol 'i' shadows an earlier one drivers/staging/rtl8192u/r8192U_core.c:2254:13: originally declared here drivers/staging/rtl8192u/r8192U_core.c:2371:29: warning: symbol 'i' shadows an earlier one drivers/staging/rtl8192u/r8192U_core.c:2254:13: originally declared here Signed-off-by: Cláudio Maia <clrrm@isep.ipp.pt> Link: https://lore.kernel.org/r/20210514230459.15752-1-clrrm@isep.ipp.pt Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: rtl8192u: fix typos in commentsIain Craig
correct spelling errors across 8 lines of comments. Signed-off-by: Iain Craig <coldcity@gmail.com> Link: https://lore.kernel.org/r/20210428141734.GA2498@ubuntu Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: rtl8192u: ieee80211_softmac: Move a large data struct onto the heapLee Jones
Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c: In function ‘ieee80211_rx_frame_softmac’: drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2009:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Romain Perier <romain.perier@gmail.com> Cc: Allen Pais <apais@linux.microsoft.com> Cc: Andrea Merello <andrea.merello@gmail.com> Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20210414181129.1628598-29-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: r819xU_cmdpkt: Remove functionless method 'cmpk_handle_query_config_rx'Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8192u/r819xU_cmdpkt.c: In function ‘cmpk_handle_query_config_rx’: drivers/staging/rtl8192u/r819xU_cmdpkt.c:274:24: warning: variable ‘rx_query_cfg’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Michael Straube <straube.linux@gmail.com> Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20210414181129.1628598-7-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: r819xU_phy: Remove some local variables from the stackLee Jones
Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8192u/r819xU_phy.c: In function ‘rtl8192_phy_SwChnlStepByStep’: drivers/staging/rtl8192u/r819xU_phy.c:1328:1: warning: the frame size of 1096 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Michael Straube <straube.linux@gmail.com> Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20210414181129.1628598-6-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: r8192U_core: Do not use kernel-doc formatting for !kernel-doc headersLee Jones
Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8192u/r8192U_core.c:3714: warning: Function parameter or member 'dev' not described in 'UpdateRxPktTimeStamp8190' drivers/staging/rtl8192u/r8192U_core.c:3714: warning: Function parameter or member 'stats' not described in 'UpdateRxPktTimeStamp8190' drivers/staging/rtl8192u/r8192U_core.c:3714: warning: expecting prototype for Function(). Prototype was for UpdateRxPktTimeStamp8190() instead drivers/staging/rtl8192u/r8192U_core.c:4314: warning: Function parameter or member 'dev' not described in 'UpdateReceivedRateHistogramStatistics8190' drivers/staging/rtl8192u/r8192U_core.c:4314: warning: Function parameter or member 'stats' not described in 'UpdateReceivedRateHistogramStatistics8190' drivers/staging/rtl8192u/r8192U_core.c:4314: warning: expecting prototype for Function(). Prototype was for UpdateReceivedRateHistogramStatistics8190() instead Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Andrea Merello <andrea.merello@gmail.com> Cc: Jerry chuang <wlanfae@realtek.com> Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20210414181129.1628598-5-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: r8192U_core: Remove unused variable 'ret' and demote kernel-doc abuseLee Jones
Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8192u/r8192U_core.c: In function ‘rtl8192_hard_data_xmit’: drivers/staging/rtl8192u/r8192U_core.c:905:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Andrea Merello <andrea.merello@gmail.com> Cc: Jerry chuang <wlanfae@realtek.com> Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20210414181129.1628598-2-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-12Staging: rtl8192u: ieee80211: remove odd backslash.Dmitrii Wolf
This backslash should be deleted - looks like leftover and not needed. Signed-off-by: Dmitrii Wolf <dev.dragon@bk.ru> Link: https://lore.kernel.org/r/20210411120301.6549-1-dev.dragon@bk.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07staging: rtl8192u: Fix potential infinite loopColin Ian King
The for-loop iterates with a u8 loop counter i and compares this with the loop upper limit of riv->ieee80211->LinkDetectInfo.SlotNum that is a u16 type. There is a potential infinite loop if SlotNum is larger than the u8 loop counter. Fix this by making the loop counter the same type as SlotNum. Addresses-Coverity: ("Infinite loop") Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210407150308.496623-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07staging: rt8192u: change constants to be on rightVardhan H G
When comparing a constant with variable, it is recommeneded to have the constant on the right side of the test. This patch silences the following checkpatch.pl warning: "Comparisons should place the constant on the right side of the test" Signed-off-by: Vardhan H G <crazylonestar7@gmail.com> Link: https://lore.kernel.org/r/20210407061749.13460-1-crazylonestar7@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07staging: rtl8192u: remove unused variableJiapeng Chong
Fix the following gcc warning: drivers/staging/rtl8192u/r8192U_core.c:3419:6: warning: variable ‘reset_status’ set but not used [-Wunused-but-set-variable]. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https://lore.kernel.org/r/1617775650-42645-1-git-send-email-jiapeng.chong@linux.alibaba.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26r8192U_wx.c: style: avoid multiple blank linesBruno Raoult
fix checkpatch.pl check: CHECK: Please don't use multiple blank lines in drivers/staging/rtl8192u/r8192U_wx.c Signed-off-by: Bruno Raoult <braoult@gmail.com> Link: https://lore.kernel.org/r/2c1f2c668d299ce1895ce97dc7fb9a67d3723e63.1616748922.git.braoult@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26r8192U_wx.c: style: Unnecessary parenthesesBruno Raoult
fix checkpatch.pl check: CHECK: Unnecessary parentheses around expr in drivers/staging/rtl8192u/r8192U_wx.c Signed-off-by: Bruno Raoult <braoult@gmail.com> Link: https://lore.kernel.org/r/f42993e183e1127dcc9fce3f0ed42dd6d795c647.1616748922.git.braoult@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26r8192U_wx.c: style: braces all arms of statementBruno Raoult
fix checkpatch.pl check: CHECK: braces {} should be used on all arms of this statement in drivers/staging/rtl8192u/r8192U_wx.c Signed-off-by: Bruno Raoult <braoult@gmail.com> Link: https://lore.kernel.org/r/adbbb5243dca7998a31a786eef277bd85068c63a.1616748922.git.braoult@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26r8192U_wx.c: style: spaces preferred around operatorsBruno Raoult
fix checkpatch.pl check: CHECK: spaces required around that <op> in drivers/staging/rtl8192u/r8192U_wx.c Signed-off-by: Bruno Raoult <braoult@gmail.com> Link: https://lore.kernel.org/r/e7298c14538ad7a58720585d019a70f637e0cdb1.1616748922.git.braoult@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26r8192U_wx.c: style: alignment with open parenthesisBruno Raoult
fix checkpatch.pl check: CHECK: Alignment should match open parenthesis in drivers/staging/rtl8192u/r8192U_wx.c Signed-off-by: Bruno Raoult <braoult@gmail.com> Link: https://lore.kernel.org/r/34f4134241f49d1694cbfb9c2185e3ef54284680.1616748922.git.braoult@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-22staging/rtl8192u: avoid Wempty-body warningArnd Bergmann
This driver has a few disabled diagnostics, which can probably just get removed, or might still be helpful: drivers/staging/rtl8192u/r8192U_core.c: In function 'rtl8192_set_rxconf': drivers/staging/rtl8192u/r8192U_core.c:767:45: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 767 | DMESG("NIC in promisc mode"); | ^ drivers/staging/rtl8192u/r8192U_core.c: In function 'rtl819xusb_rx_command_packet': drivers/staging/rtl8192u/r8192U_core.c:883:80: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 883 | DMESG("rxcommandpackethandle819xusb: It is a command packet\n"); | ^ Changing the empty macro to no_printk() to shut up the compiler warnings and add format string checking. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20210322103545.704121-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-18Staging: rtl8192u: fixed a whitespace coding style issuezhaoxiao
Removed additional whitespaces in the r8192U_wx.c file. Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com> Link: https://lore.kernel.org/r/20210317033219.621-1-zhaoxiao@uniontech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-16staging: rtl8192u: fixed no space coding style issue.zhaoxiao
Added space around the binary operator for readability in r8192U_wx.c file Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com> Link: https://lore.kernel.org/r/20210315061202.10219-1-zhaoxiao@uniontech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-15Merge 5.12-rc3 into staging-nextGreg Kroah-Hartman
We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-12staging: rtl8192u: ieee80211: Remove braces for single line blocksAtul Gopinathan
Remove braces around those `if` and `for` blocks which contain a single line and therefore fix the Checkpatch warning of the following type: "WARNING: braces {} are not necessary for single statement blocks" Signed-off-by: Atul Gopinathan <atulgopinathan@gmail.com> Link: https://lore.kernel.org/r/20210310104353.14531-1-atulgopinathan@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10staging: rt8192u: Move constant in comparison to the RHSSimone Serra
Fixes checkpatch warning: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Simone Serra <serrazimone@gmail.com> Link: https://lore.kernel.org/r/20210223234102.15784-1-serrazimone@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10staging: rtl8192u: remove unnecessary return in r8190_rtl8256.cDu Cheng
remove the unnecessary return at the end of function phy_set_rf8256_ofdm_tx_power(), reported by scripts/checkpatch.pl. Signed-off-by: Du Cheng <ducheng2@gmail.com> Link: https://lore.kernel.org/r/20210219150527.8358-2-ducheng2@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10staging: rtl8192u: fix RT_TRACE() in r8190_rtl8256.cDu Cheng
use MACRO __func__ instead of the literal names for RT_TRACE() in phy_set_rf8256_bandwidth() and phy_rf8256_config_para_file(), as reported by scripts/checkpatch.pl. Signed-off-by: Du Cheng <ducheng2@gmail.com> Link: https://lore.kernel.org/r/20210219150527.8358-1-ducheng2@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10staging: rtl8192u: fix ->ssid overflow in r8192_wx_set_scan()Dan Carpenter
We need to cap len at IW_ESSID_MAX_SIZE (32) to avoid memory corruption. This can be controlled by the user via the ioctl. Fixes: 5f53d8ca3d5d ("Staging: add rtl8192SU wireless usb driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/YEHoAWMOSZBUw91F@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-04staging: rtl8192u: Switch from strlcpy to strscpyKumar Kartikeya Dwivedi
strlcpy is marked as deprecated in Documentation/process/deprecated.rst, and there is no functional difference when the caller expects truncation (when not checking the return value). strscpy is relatively better as it also avoids scanning the whole source string. This silences the related checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20210131172838.146706-11-memxor@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-31staging: rtl8192u/ieee80211: fix switch case indentationAnirudh Rayabharam
Make switch and case to be at the same indent. This fixes the checkpatch error "switch and case should be at the same indent". Signed-off-by: Anirudh Rayabharam <mail@anirudhrb.com> Link: https://lore.kernel.org/r/20210131131226.16917-1-mail@anirudhrb.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-26Staging: rtl8192u: use %s and __func__Puranjay Mohan
Change function's name to %s and __func__ to fix checkpatch.pl errors. Signed-off-by: Puranjay Mohan <puranjay12@gmail.com> Link: https://lore.kernel.org/r/20210124144328.121688-1-puranjay12@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-05staging: rtl819x: select CONFIG_CRC32Arnd Bergmann
Without crc32 support, the drivers fail to link: ERROR: modpost: "crc32_le" [drivers/staging/rtl8192e/rtllib_crypt_wep.ko] undefined! ERROR: modpost: "crc32_le" [drivers/staging/rtl8192e/rtllib_crypt_tkip.ko] undefined! ERROR: modpost: "crc32_le" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined! Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20210103214034.1995821-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-28staging: rtl8192u: Add null check in rtl8192_usb_initendpointsDinghao Liu
There is an allocation for priv->rx_urb[16] has no null check, which may lead to a null pointer dereference. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Link: https://lore.kernel.org/r/20201226080258.6576-1-dinghao.liu@zju.edu.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>