aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8188eu/core (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-09-12staging: rtl8188eu: make two arrays static const, makes object smallerColin Ian King1-2/+2
Don't populate two arrays on the stack but instead make them static const. Makes the object code smaller by 49 bytes. Before: text data bss dec hex filename 26821 5616 0 32437 7eb5 rtl8188eu/core/rtw_ieee80211.o After: text data bss dec hex filename 26612 5776 0 32388 7e84 rtl8188eu/core/rtw_ieee80211.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20190906173949.21860-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-03staging: r8188eu: use skb_put_data instead of skb_put/memcpy pairIvan Safonov1-5/+1
skb_put_data is shorter and clear. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Link: https://lore.kernel.org/r/20190901195301.GA16043@alpha Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-08Staging: rtl8188eu: core: rtw_security: tidy up crc32_init()Merwin Trever Ferrao1-21/+20
This code generates checkpatch warning: WARNING: else is not generally useful after a break or return Moving the declaration to the top of the function we can pull the code back one tab and it makes it more readable. Signed-off-by: Merwin Trever Ferrao <merwintf@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20190806122849.GA25628@IoT-COE Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-05staging: rtl8188eu: core: add spaces around '-', '+', '>>','<<' and '*' in rtw_efuse.cSaurav Girepunje1-64/+64
Add spaces around '-', '+', '>>','<<' and '*' to improve readability and follow kernel coding style. Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com> Link: https://lore.kernel.org/r/20190803131839.GA14077@saurav Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-03staging: rtl8188eu: core: rtw_recv.c: Remove Unnecessary parenthesesSaurav Girepunje1-4/+4
Remove Unnecessary parentheses around precvframe->list, pmlmeext->mlmext_info and precvpriv->free_recv_queue Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com> Link: https://lore.kernel.org/r/20190803064408.GA30111@saurav Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30staging: rtl8188eu: replace hal_EfusePgCheckAvailableAddr()Michael Straube1-12/+1
Function hal_EfusePgCheckAvailableAddr() contains just a single if test. Remove the function and replace the call to it with the if test. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20190725170922.16465-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: rtl8188eu: Replace function rtw_alloc_network()Nishka Dasgupta2-8/+3
Change external call site of _rtw_alloc_network to rtw_alloc_network. Remove function rtw_alloc_network as all it does is call _rtw_alloc_network. Rename _rtw_alloc_network to rtw_alloc_network to maintain compatibility with call sites. Keep its type as non-static (even though the old rtw_alloc_network was static) as this functionality is used in other files as well. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712071746.2474-6-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: rtl8188eu: Remove function rtw_os_indicate_scan_done()Nishka Dasgupta1-1/+1
In function rtw_indicate_scan_done, replace call to rtw_os_indicate_scan_done with call to indicate_wx_scan_complete_event as all that rtw_os_indicate_scan_done does is call indicate_wx_scan_complete_event. Remove now-unused function rtw_os_indicate_scan_done. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712071746.2474-4-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: rtl8188eu: Replace function beacon_timing_control()Nishka Dasgupta1-5/+0
Remove function beacon_timing_control as all it does is call rtw_hal_bcn_related_reg_setting. Rename rtw_hal_bcn_related_reg_setting to beacon_timing_control for compatibility with call sites. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712071746.2474-3-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: rtl8188eu: core: Remove function enable_rate_adaptive()Nishka Dasgupta1-6/+1
Remove function enable_rate_adaptive as it does nothing except call Update_RA_Entry. Modify call site of enable_rate_adaptive to call Update_RA_Entry instead. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712071746.2474-2-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: rtl8188eu: core: Replace function Set_MSR()Nishka Dasgupta2-7/+2
Change reference to Set_NETYPE0_MSR to Set_MSR. Replace the contents of Set_MSR with the contents of Set_NETYPE0_MSR as Set_MSR does nothing but call Set_NETYPE0_MSR. Delete Set_NETYPE0_MSR. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712071746.2474-1-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-26staging: rtl8188eu: remove unused function is_ap_in_wep()Michael Straube1-30/+0
Function is_ap_in_wep() is not used in the driver code, so remove it. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-26staging: rtl8188eu: remove unused function get_bsstype()Michael Straube1-10/+0
Function get_bsstype() is not used in the driver code, so remove it. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-20staging: rtl8188eu: remove unused codeMichael Straube1-6/+0
Remove unused and/or commented code from rtw_wlan_util.c. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-13staging: rtl8188eu: Change type of rtw_get_sec_ie()Nishka Dasgupta1-3/+1
Change return type of function rtw_get_sec_ie from int to void and remove its return statement as the return value is never stored, checked or otherwise used. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-09staging: rtl8188eu: core: Replace function rtw_free_network_nolock()Nishka Dasgupta1-7/+2
Remove function rtw_free_network_nolock, as all it does is call _rtw_free_network_nolock, and rename _rtw_free_network_nolock to rtw_free_network_nolock. Keep the new rtw_free_network_nolock a static function and remove the old version from the header file. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-06staging: rtl8188eu: core: Remove initialisation of return variableNishka Dasgupta1-1/+1
Remove initialisation of return variable as it is never used. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-22Staging: rtl8188eu: core: Use !x in place of NULL comparisonsPuranjay Mohan1-7/+7
Change (x == NULL) to !x and (x != NULL) to x, to fix following checkpatch.pl warnings: CHECK: Comparison to NULL could be written "!x". Signed-off-by: Puranjay Mohan <puranjay12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21Staging: rtl8188eu: core: Remove else after breakPuranjay Mohan1-14/+12
Remove else after break statements to fix following checkpatch.pl warnings: WARNING: else is not generally useful after a break or return. Signed-off-by: Puranjay Mohan <puranjay12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25staging: rtl8188eu: remove unnecessary parenthesesMichael Straube2-4/+4
Remove unnecessary parentheses to improve readability. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25staging: rtl8188eu: add spaces around '-' in rtw_cmd.cMichael Straube1-2/+2
Add spaces around '-' to follow kernel coding style. Reported by checkpatch. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25staging: rtl8188eu: replace subtraction with resultMichael Straube1-2/+2
Replace subtraction with the result to improve readability and clear missing spaces around '-' checkpatch issues. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25staging: rtl8188eu: add spaces around operators in rtw_ap.cMichael Straube1-9/+12
Add spaces around '+', '-' and '|' to follow kernel coding style. Reported by checkpatch. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: rtl8188eu: make sta2sta_data_frame() staticMichael Straube1-2/+3
Function sta2sta_data_frame() is only used in rtw_recv.c. So make it static. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: rtl8188eu: remove unnecessary declarationMichael Straube1-6/+0
The declaration of sta2sta_data_frame() is directly above the function definition. Remove the unnecessary declaration. This also clears a checkpatch issue. CHECK: Lines should not end with a '(' Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-01staging: rtl8188eu: Modify return statement.Sanjana Sanikommu1-5/+1
Challenge suggested by coccinelle. Remove return variable and directly return the value Issue found using ret.cocci Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-01Merge 5.1-rc3 into staging-nextGreg Kroah-Hartman1-2/+7
We want those fixes and this resolves an erofs merge conflict. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21staging: rtl8188eu: core: Add spaces around operatorsVatsala Narang1-3/+3
Add spaces around '+' operator to get rid of checkpatch warning. Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21staging: rtl8188eu: core: Remove unnecessary parenthesesVatsala Narang1-5/+5
Remove unnecessary parentheses after 'address-of' operator Issue found with checkpatch.pl Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21staging: rtl8188eu: core: rtw_mlme: Remove return variables.Sanjana Sanikommu1-2/+1
The last two lines in the function could be compressed into one. Avoid usage of local variable. Issue found with Coccinelle using ret.cocci. Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21staging: rtl8188eu: Fix potential NULL pointer dereference of kcallocAditya Pakki1-2/+7
hwxmits is allocated via kcalloc and not checked for failure before its dereference. The patch fixes this problem by returning error upstream in rtl8723bs, rtl8188eu. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Acked-by: Mukesh Ojha <mojha@codeaurora.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21staging: r8188eu: refactor recvframe_defrag()Ivan Safonov1-7/+6
Local variables pfhdr and prframe always have a same value, so one of them is unnecessary. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21staging: rtl8188eu: core: rtw_recv.c: Modify return type suggested by Coccinelle.Sanjana Sanikommu1-4/+2
The last two lines in the function could be compressed into one. Avoid usage of local variable. Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18Staging: rtl8188eu: rtw_ieee80211: Fix indent for 'if' statement.Sanjana Sanikommu1-3/+3
Adjust indentation for the condition statement. Issue found by checkpatch.pl WARNING: suspect code indent for condition statements(8,24) Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18Staging: rtl8188eu: core: rtw_mlme.c: Replace NULL comparision.Sanjana Sanikommu1-1/+1
Replace NULL comparison with '!' in the file rtw_mlme.c Issue found by checkpatch.pl semantic patch results for rtw_mlme.c CHECK:Comparision to NULL could be written "!candidate" Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18Staging: rtl8188eu: core: rtw_pwrctrl.c: Fix a comparision warning.Sanjana Sanikommu1-1/+1
Move the constant to the right side of comparision. Issue found by checkpatch.pl semantic patch results for rtw_ap.c WARNING:Comparision should place the constant on the right side of the test. Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8188eu: core: rtw_recv.c: Fix a tab indent issueSanjana Sanikommu1-2/+2
Fix a tab indent issue which removed warnings after compilation using checkpatch.pl. [WARNING]:No extra space at the beginning of a line. Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8188eu: core: rtw_recv.c: fix a paranthesis issue around pframe -> list in rtw_recv.cSanjana Sanikommu1-4/+4
Remove unnecessary parathesis issue around '->' . Issue found by checkpatch.pl semantic patch results for rtw_recv.c CHECK: Remove unnecessary paranthesis around pframe -> list Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8188eu: core: rtw_recv.c: fix a space issueSanjana Sanikommu1-5/+7
Fix a space issue around the below operators mentioned in CHECK. Issue found by checkpatch.pl semantic patch results for rtw_recv.c.. CHECK: spaces preferred around '%' (ctx:VxV) CHECK: spaces preferred around '&' (ctx:VxV) CHECK: spaces preferred around '+' (ctx:VxV) CHECK: spaces preferred around '<<' (ctx:VxV) Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8188eu: core: rtw_ap.c: Fix multiple blank linesSanjana Sanikommu1-1/+0
Remove multiple blank lines. Issue found by checkpatch.pl semantic patch results for rtw_ap.c CHECK: Please dont use multiple blank lines. Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8188eu: cleanup spacing styleRobert Eshleman1-3/+3
This patch fixes a few spacing warnings from checkpatch.pl, as well as an incorrect spacing between a function type and the function name. Signed-off-by: Robert Eshleman <bobbyeshleman@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-19staging: rtl8188eu: fix bad indentation for conditional statementStephen Martin1-1/+1
Fixed else block indentation Signed-off-by: Stephen Martin <lockwood@opperline.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-25staging: rtw_ieee80211: fix constant comparison warningStephen Martin1-2/+2
Fixed comparison on right side of test warnings. Signed-off-by: Stephen Martin <lockwood@opperline.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15staging: rtl8188eu: Refactoring struct ndis_802_11_ssid from CamelCase to correct code style.Florian Büstgens7-69/+69
rtl8188eu uses CamelCase for many struct members. Refactors the ndis_802_11_ssid members Ssid and SsidLength to keep correct code style. Issue found by checkpatch. Signed-off-by: Florian Büstgens <flbue@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15staging: rtl8188eu: Replace kzalloc with kcallocGustavo A. R. Silva1-1/+3
Replace kzalloc() function with its 2-factor argument form, kcalloc(). This patch replaces cases of: kzalloc(a * b, gfp) with: kcalloc(a, b, gfp) This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-07staging: rtl8188eu: Fix module loading from tasklet for WEP encryptionLarry Finger1-2/+2
Commit 2b2ea09e74a5 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames") causes scheduling while atomic bugs followed by a hard freeze whenever the driver tries to connect to a WEP-encrypted network. Experimentation showed that the freezes were eliminated when module lib80211 was preloaded, which can be forced by calling lib80211_get_crypto_ops() directly rather than indirectly through try_then_request_module(). With this change, no BUG messages are logged. Fixes: 2b2ea09e74a5 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames") Cc: Stable <stable@vger.kernel.org> # v4.17+ Cc: Michael Straube <straube.linux@gmail.com> Cc: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-07staging: rtl8188eu: Fix module loading from tasklet for CCMP encryptionLarry Finger1-1/+1
Commit 6bd082af7e36 ("staging:r8188eu: use lib80211 CCMP decrypt") causes scheduling while atomic bugs followed by a hard freeze whenever the driver tries to connect to a CCMP-encrypted network. Experimentation showed that the freezes were eliminated when module lib80211 was preloaded, which can be forced by calling lib80211_get_crypto_ops() directly rather than indirectly through try_then_request_module(). With this change, no BUG messages are logged. Fixes: 6bd082af7e36 ("staging:r8188eu: use lib80211 CCMP decrypt") Cc: Stable <stable@vger.kernel.org> # v4.17+ Reported-and-tested-by: Michael Straube <straube.linux@gmail.com> Cc: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19staging: rtl8188eu: cleanup brace coding style issuesMichael Straube2-4/+3
Cleanup brace coding style issues reported by checkpatch. ERROR: space required before the open brace '{' WARNING: braces {} are not necessary for single statement blocks CHECK: Unbalanced braces around else statement Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19staging: rtl8188eu: add spaces around '&' in rtw_mlme_ext.cMichael Straube1-45/+45
Add spaces around '&' to follow kernel coding style. Reported by checkpatch. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19staging: rtl8188eu: change return type of is_basicrate() to boolMichael Straube1-1/+1
The function is_basicrate() returns true or false, so change the return type from int to bool. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>