aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8723bs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-06-12treewide: Use array_size() in vzalloc()Kees Cook1-1/+1
The vzalloc() function has no 2-factor argument form, so multiplication factors need to be wrapped in array_size(). This patch replaces cases of: vzalloc(a * b) with: vzalloc(array_size(a, b)) as well as handling cases of: vzalloc(a * b * c) with: vzalloc(array3_size(a, b, c)) This does, however, attempt to ignore constant size factors like: vzalloc(4 * 1024) though any constants defined via macros get caught up in the conversion. Any factors with a sizeof() of "unsigned char", "char", and "u8" were dropped, since they're redundant. The Coccinelle script used for this was: // Fix redundant parens around sizeof(). @@ type TYPE; expression THING, E; @@ ( vzalloc( - (sizeof(TYPE)) * E + sizeof(TYPE) * E , ...) | vzalloc( - (sizeof(THING)) * E + sizeof(THING) * E , ...) ) // Drop single-byte sizes and redundant parens. @@ expression COUNT; typedef u8; typedef __u8; @@ ( vzalloc( - sizeof(u8) * (COUNT) + COUNT , ...) | vzalloc( - sizeof(__u8) * (COUNT) + COUNT , ...) | vzalloc( - sizeof(char) * (COUNT) + COUNT , ...) | vzalloc( - sizeof(unsigned char) * (COUNT) + COUNT , ...) | vzalloc( - sizeof(u8) * COUNT + COUNT , ...) | vzalloc( - sizeof(__u8) * COUNT + COUNT , ...) | vzalloc( - sizeof(char) * COUNT + COUNT , ...) | vzalloc( - sizeof(unsigned char) * COUNT + COUNT , ...) ) // 2-factor product with sizeof(type/expression) and identifier or constant. @@ type TYPE; expression THING; identifier COUNT_ID; constant COUNT_CONST; @@ ( vzalloc( - sizeof(TYPE) * (COUNT_ID) + array_size(COUNT_ID, sizeof(TYPE)) , ...) | vzalloc( - sizeof(TYPE) * COUNT_ID + array_size(COUNT_ID, sizeof(TYPE)) , ...) | vzalloc( - sizeof(TYPE) * (COUNT_CONST) + array_size(COUNT_CONST, sizeof(TYPE)) , ...) | vzalloc( - sizeof(TYPE) * COUNT_CONST + array_size(COUNT_CONST, sizeof(TYPE)) , ...) | vzalloc( - sizeof(THING) * (COUNT_ID) + array_size(COUNT_ID, sizeof(THING)) , ...) | vzalloc( - sizeof(THING) * COUNT_ID + array_size(COUNT_ID, sizeof(THING)) , ...) | vzalloc( - sizeof(THING) * (COUNT_CONST) + array_size(COUNT_CONST, sizeof(THING)) , ...) | vzalloc( - sizeof(THING) * COUNT_CONST + array_size(COUNT_CONST, sizeof(THING)) , ...) ) // 2-factor product, only identifiers. @@ identifier SIZE, COUNT; @@ vzalloc( - SIZE * COUNT + array_size(COUNT, SIZE) , ...) // 3-factor product with 1 sizeof(type) or sizeof(expression), with // redundant parens removed. @@ expression THING; identifier STRIDE, COUNT; type TYPE; @@ ( vzalloc( - sizeof(TYPE) * (COUNT) * (STRIDE) + array3_size(COUNT, STRIDE, sizeof(TYPE)) , ...) | vzalloc( - sizeof(TYPE) * (COUNT) * STRIDE + array3_size(COUNT, STRIDE, sizeof(TYPE)) , ...) | vzalloc( - sizeof(TYPE) * COUNT * (STRIDE) + array3_size(COUNT, STRIDE, sizeof(TYPE)) , ...) | vzalloc( - sizeof(TYPE) * COUNT * STRIDE + array3_size(COUNT, STRIDE, sizeof(TYPE)) , ...) | vzalloc( - sizeof(THING) * (COUNT) * (STRIDE) + array3_size(COUNT, STRIDE, sizeof(THING)) , ...) | vzalloc( - sizeof(THING) * (COUNT) * STRIDE + array3_size(COUNT, STRIDE, sizeof(THING)) , ...) | vzalloc( - sizeof(THING) * COUNT * (STRIDE) + array3_size(COUNT, STRIDE, sizeof(THING)) , ...) | vzalloc( - sizeof(THING) * COUNT * STRIDE + array3_size(COUNT, STRIDE, sizeof(THING)) , ...) ) // 3-factor product with 2 sizeof(variable), with redundant parens removed. @@ expression THING1, THING2; identifier COUNT; type TYPE1, TYPE2; @@ ( vzalloc( - sizeof(TYPE1) * sizeof(TYPE2) * COUNT + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2)) , ...) | vzalloc( - sizeof(TYPE1) * sizeof(THING2) * (COUNT) + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2)) , ...) | vzalloc( - sizeof(THING1) * sizeof(THING2) * COUNT + array3_size(COUNT, sizeof(THING1), sizeof(THING2)) , ...) | vzalloc( - sizeof(THING1) * sizeof(THING2) * (COUNT) + array3_size(COUNT, sizeof(THING1), sizeof(THING2)) , ...) | vzalloc( - sizeof(TYPE1) * sizeof(THING2) * COUNT + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2)) , ...) | vzalloc( - sizeof(TYPE1) * sizeof(THING2) * (COUNT) + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2)) , ...) ) // 3-factor product, only identifiers, with redundant parens removed. @@ identifier STRIDE, SIZE, COUNT; @@ ( vzalloc( - (COUNT) * STRIDE * SIZE + array3_size(COUNT, STRIDE, SIZE) , ...) | vzalloc( - COUNT * (STRIDE) * SIZE + array3_size(COUNT, STRIDE, SIZE) , ...) | vzalloc( - COUNT * STRIDE * (SIZE) + array3_size(COUNT, STRIDE, SIZE) , ...) | vzalloc( - (COUNT) * (STRIDE) * SIZE + array3_size(COUNT, STRIDE, SIZE) , ...) | vzalloc( - COUNT * (STRIDE) * (SIZE) + array3_size(COUNT, STRIDE, SIZE) , ...) | vzalloc( - (COUNT) * STRIDE * (SIZE) + array3_size(COUNT, STRIDE, SIZE) , ...) | vzalloc( - (COUNT) * (STRIDE) * (SIZE) + array3_size(COUNT, STRIDE, SIZE) , ...) | vzalloc( - COUNT * STRIDE * SIZE + array3_size(COUNT, STRIDE, SIZE) , ...) ) // Any remaining multi-factor products, first at least 3-factor products // when they're not all constants... @@ expression E1, E2, E3; constant C1, C2, C3; @@ ( vzalloc(C1 * C2 * C3, ...) | vzalloc( - E1 * E2 * E3 + array3_size(E1, E2, E3) , ...) ) // And then all remaining 2 factors products when they're not all constants. @@ expression E1, E2; constant C1, C2; @@ ( vzalloc(C1 * C2, ...) | vzalloc( - E1 * E2 + array_size(E1, E2) , ...) ) Signed-off-by: Kees Cook <keescook@chromium.org>
2018-05-25staging: rtl8723bs: Fix grammar error in comment.Quytelda Kahja1-1/+1
Fix a grammatical error in the comment describing 'struct rt_firmware_hdr'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: rtl8723bs: Fix camel-case in 'struct rt_firmware_hdr'.Quytelda Kahja2-23/+23
Replace camel-case member names with snake-case names per the linux kernel coding style guidelines. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: rtl8723bs: Fix spelling/grammar errors in comment.Quytelda Kahja1-2/+2
Fix the spelling/grammar errors in the comment block describing the 'Function' member of 'struct rt_firmware_hdr'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: rtl8723bs: Fix camel-case in 'struct rt_firmware'.Quytelda Kahja2-10/+10
Change the members of 'struct rt_firmware' to be snake case instead of camel-case, per the kernel coding style guide. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: rtl8723bs: Fix camel-case in IS_FW_HEADER_EXIST_8723B().Quytelda Kahja1-2/+2
Change the parameter of the macro to the snake case 'fw_hdr' instead of '_pFwHdr'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: rtl8723bs: Clean up whitespace in 'rtl8723_hal.h'.Quytelda Kahja1-117/+144
Make alignment and whitespace more consistent within the file 'rtl8723_hal.h' and with the kernel coding style guidelines. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: rtl8723bs: Rename 'Hal8723BPhyCfg.h' using snake case.Quytelda Kahja2-1/+1
Camel-case is discouraged in the linux kernel coding style. Rename this header file using snake case instead. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: rtl8723bs: Rename 'Hal8723bPhyReg.h' using snake case.Quytelda Kahja2-1/+1
Camel-case is discouraged in the linux kernel coding style. Rename this header using snake case instead. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: rtl8723bs: Rename 'Hal8723BPwrSeq.{c, h}' to 'hal_pwr_seq.*'.Quytelda Kahja4-3/+3
Camel-case naming is discouraged int the linux kernel coding style. Rename these files using snake case, and update the makefile to use the new names. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-15staging: rtl8723bs: Fix checkpatch.pl errorsSidong Yang1-13/+12
Move open brace to same line with enum. Remove prohibited space before ','. Signed-off-by: Sidong Yang <realwakka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: rtl8723bs: Replace license boilerplate with SPDX identifiersNathan Chancellor167-1494/+167
This satisfies a checkpatch.pl warning and is the preferred method for notating the license due to its lack of ambiguity. Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: rtl8723bs: fix spelling mistakes: "dismatch" and "Inviation"Colin Ian King2-7/+7
Trivial fix to spelling mistakes in message text and comments "dismatch" -> "mismatch" "Inviation" -> "Invitation" Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: rtl8723bs: fix rtw_cfg80211_monitor_if_xmit_entry()'s return typeLuc Van Oostenryck1-1/+1
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Remove yield call, replace with cond_resched()Thomas Avery1-1/+1
Remove yield() call. Yield does not guarantee progress, cond_resched() is a safer alternative Signed-off-by: Thomas Avery <tavery321@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Replace yield() call with cond_resched()Thomas Avery1-1/+1
Remove yield call(). yield does not guarantee progress, and should not be used. cond_resched() is a safe alternative. Signed-off-by: Thomas Avery <tavery321@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Remove unecessary newlines from 'odm.h'.Quytelda Kahja1-27/+0
Remove duplicate newlines and newlines before closing braces. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Rework 'struct _ODM_Phy_Status_Info_' coding style.Quytelda Kahja7-84/+90
Change the typedef'd 'struct _ODM_Phy_Status_Info_' into 'struct odm_phy_info' and change the members to snake case in order to meet the coding style guidelines. Members: * u8 RxPWDBAll -> rx_pwd_ba11 * u8 SignalQuality -> signal_quality * s8 RxMIMOSignalQuality -> rx_mimo_signal_quality * u8 RxMIMOEVMdbm -> rx_mimo_evm_dbm * u8 RxMIMOSignalStrength -> rx_mimo_signal_strength * u16 Cfo_short -> cfo_short * u16 Cfo_tail -> cfo_tail * s8 RxPower -> rx_power * s8 RecvSignalPower -> recv_signal_power * u8 BTRxRSSIPercentage -> bt_rx_rssi_percentage * u8 SignalStrength -> signal_strength * s8 RxPwr -> rx_pwr * u8 RxSNR -> rx_snr * u8 BandWidth => band_width * u8 btCoexPwrAdjust -> bt_coex_pwr_adjust Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Rework 'struct _ODM_Per_Pkt_Info_' coding style.Quytelda Kahja5-42/+43
Change the typedef'd 'struct _ODM_Per_Pkt_Info_' into 'struct odm_packet_info' and change the members to snake case in order to meet the coding style guidelines. Members: * u8 DataRate -> data_rate * u8 StationID -> station_id * bool bPacketMatchBSSID -> bssid_match * bool bPacketToSelf -> to_self * bool bPacketBeacon -> is_beacon * bool bToSelf -> (removed because it isn't used) Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Replace NULL pointer comparison with '!'.Quytelda Kahja1-1/+1
Replace the comparison of 'precvbuf' to 'NULL' with '!precvbuf'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Factor out rtl8723bs_recv_tasklet() sections.Quytelda Kahja1-26/+69
Factor out code from rtl8723bs_recv_tasklet() into helper methods to unindent lines over 80 characters. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Fix function signature that goes over 80 characters.Quytelda Kahja1-1/+2
Wrap the function parameters for rtl8723bs_c2h_packet_handler() so the function signature doesn't exceed 80 characters. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Fix lines too long in update_recvframe_attrib().Quytelda Kahja1-8/+22
Fix lines over the 80 character limit in update_recvframe_attrib(). Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Remove unnecessary blank lines in 'rtl8723bs_recv.c'.Quytelda Kahja1-7/+0
Condense multiple blank lines to one, and remove blank lines before braces. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Change camel case to snake case in 'rtl8723bs_recv.c'.Quytelda Kahja1-16/+16
Linux kernel coding style dictates the use of snake case for variable naming. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Add missing braces in else statement.Quytelda Kahja1-1/+2
The style rule to leave out braces in single line conditional statements doesn't apply when one branch is multiple lines. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Add spaces around ternary operators.Quytelda Kahja1-1/+1
The Linux kernel coding style calls for spaces around binary and ternary operators. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Fix lines with trailing open parentheses.Quytelda Kahja1-6/+5
Realign the arguments for update_recvframe_attrib() and update_recvframe_phyinfo() so there is no trailing open parenthesis. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Remove unnecessary length #define's.Quytelda Kahja2-19/+3
This driver statically defines constants representing the size of certain structs using literal integers as values. Replace those constants with the sizeof() macro. Other length constants are already defined in 'linux/ieee80211.h'; remove those #define's. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Fix IEEE80211 authentication algorithm constants.Quytelda Kahja2-12/+8
This driver's local ieee80211 include file defines the constants AUTH_ALG_* to represent authenication algorithm options. However, these constants are defined in 'linux/ieee80211.h' as WLAN_AUTH_*, and have the correct values. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Fix alignment in rtw_wx_set_auth().Quytelda Kahja1-3/+3
Realign the function parameters and comment blocks to match the kernel coding style. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Remove braces from single statement conditionals.Quytelda Kahja1-9/+9
Several conditionals in rtw_wx_set_auth() contain a comment then a single statement. Move the comments to the top of the conditionals so that braces can be removed from the statements, which saves space and makes the code more readable. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Remove unecessary braces from switch statement.Quytelda Kahja1-27/+23
The switch statement in rtw_wx_set_auth() wraps individual cases in braces for no reason. Remove those braces and unindent the code. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Fix newlines in rtw_wx_set_auth().Quytelda Kahja1-9/+1
There are a lot of extra newlines in this function that waste space. Remove those newlines, but add one newline before the return statement. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Replace RTW_IEEE80211_STYPE_* with IEEE80211_STYPE_*.Quytelda Kahja3-45/+2
This driver defines the constants RTW_IEEE80211_STYPE_*, but all these values are already defined in 'linux/ieee80211.h' as IEEE80211_STYPE_*. Remove the locally defined constants, and substitute the kernel constants. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Replace RTW_IEEE80211_FTYPE_* with IEEE80211_FTYPE_*.Quytelda Kahja3-8/+3
This driver defines the constants RTW_IEEE80211_FTYPE_*, but all these values are already defined in 'linux/ieee80211.h' as IEEE80211_FTYPE_*. Remove the locally defined constants, and substitute the kernel constants. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Replace RTW_IEEE80211_FCTL_* with IEEE80211_FCTL_*.Quytelda Kahja3-20/+6
This driver defines the constants RTW_IEEE80211_FCTL_* for frame control constants, but all these values are already defined in 'linux/ieee80211.h' as IEEE80211_FCTL_*. Remove the locally defined constants, and substitute the kernel constants. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29staging: rtl8723bs: Remove #defines shadowing enums in 'linux/ieee80211.h'Quytelda Kahja1-56/+0
The modified file includes 'linux/ieee80211.h', but #define's many constants that shadow enum members in the header. This will create a conflict if the values are ever changed in the kernel. Remove these Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-28staging: rtl8723bs: Remove duplicate #defines.Quytelda Kahja1-12/+0
The modified file includes 'linux/ieee80211.h', but redefines many constants that already exist in the header. This will create a conflict if the values are ever changed in the kernel. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22Staging:rtl8723bs:Add blank line after declarationPaul McQuade1-0/+1
missing a blank line after declaration checkpatch warnings. Issue found by checkpatch.pl Signed-off-by: Paul McQuade <paulmcquad@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22Staging:rtl8723bs clean up spacesPaul McQuade1-8/+8
Used checkpatch.pl to clean up spaces around for statements to make it easier to read Signed-off-by: Paul McQuade <paulmcquad@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22Staging:rtl8723bs Remove unnecessary bracesPaul McQuade1-3/+3
Remove unnecessary parentheses highlighted by checkpatch.pl Signed-off-by: Paul McQuade <paulmcquad@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22Staging:rtl8723bs static variables are always 0Paul McQuade1-1/+1
C standard guarantees that: global and static variables will be implicitly initialized to 0 or NULL if no explicit initializer is given. Signed-off-by: Paul McQuade <paulmcquad@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-14staging: rtl8723bs: core: rtw_cmd: remove unnecessary initializationJi-Hun Kim1-1/+1
Clean up checkpatch error: ERROR: do not initialise globals to 0 Signed-off-by: Ji-Hun Kim <ji_hun.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: rtl8723bs: Replace memset with eth_zero_addrArushi Singhal3-6/+9
Use eth_zero_addr to assign zero address to the given address array instead of memset when the second argument in memset is address of zero. Coccinelle was used to do the replacement and add the header file linux/etherdevice.h if not already present. The Coccinelle semantic patch that makes this change is as follows: @header@ @@ #include <linux/etherdevice.h> @r1@ expression e; @@ -memset(e,0x00,ETH_ALEN); +eth_zero_addr(e); @includeheader depends on r1 && !header@ @@ + #include <linux/etherdevice.h> #include <...> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: rtl8723bs: Remove unnecessary semicolon.Arushi Singhal2-2/+2
Remove unnecessary semicolon using semicolon.cocci Coccinelle script. Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-01staging: rtl8723bs: fix u8 less than zero checkColin Ian King1-1/+1
The error variable ret is currently a u8 and so two comparisons to see if an error return is less than zero will always be false because ret is unsigned. Fix this by making ret an int. Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-01staging: rtl8723bs: use kmemdup for allocation and copyDafna Hirschfeld1-2/+1
Use kmemdup instead of kzalloc and memcpy to simplify the code. Issue found with coccicheck. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: rtl8723bs: Remove unneeded castChristopher Diaz Riveros1-1/+1
Fix Coccinelle alert: drivers/staging//rtl8723bs/os_dep/sdio_intf.c:340:13-27: WARNING: casting value returned by memory allocation function to (struct adapter *) is useless. This issue was detected by using the Coccinelle software. Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-19staging: rtl8723bs: clean up conditionalsDafna Hirschfeld1-17/+7
Move all closing braces and parentheses to the end of the line. Remove braces from 'if' statements with a single 'then' line. Move logical operators to the end of lines in multiline conditional. Remove unnecessary parentheses. Issues found with checkpatch.pl Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>