summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8723bs/core
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Use array_size() in vzalloc()Kees Cook2018-06-121-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>
* staging: rtl8723bs: Replace license boilerplate with SPDX identifiersNathan Chancellor2018-05-1119-171/+19
| | | | | | | | 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>
* staging: rtl8723bs: Remove yield call, replace with cond_resched()Thomas Avery2018-03-291-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>
* staging: rtl8723bs: Replace yield() call with cond_resched()Thomas Avery2018-03-291-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>
* staging: rtl8723bs: Remove unnecessary length #define's.Quytelda Kahja2018-03-291-3/+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>
* staging: rtl8723bs: Replace RTW_IEEE80211_STYPE_* with IEEE80211_STYPE_*.Quytelda Kahja2018-03-291-1/+1
| | | | | | | | | 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>
* staging: rtl8723bs: Replace RTW_IEEE80211_FTYPE_* with IEEE80211_FTYPE_*.Quytelda Kahja2018-03-291-1/+1
| | | | | | | | | 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>
* staging: rtl8723bs: Replace RTW_IEEE80211_FCTL_* with IEEE80211_FCTL_*.Quytelda Kahja2018-03-291-1/+1
| | | | | | | | | | 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>
* staging: rtl8723bs: core: rtw_cmd: remove unnecessary initializationJi-Hun Kim2018-03-141-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>
* staging: rtl8723bs: Replace memset with eth_zero_addrArushi Singhal2018-03-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* staging: rtl8723bs: Remove unnecessary semicolon.Arushi Singhal2018-03-061-1/+1
| | | | | | | | 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>
* Staging: rtl8723bs: Do not check for NOT NULL before kfree()Shreeya Patel2017-12-211-3/+1
| | | | | | | | | | | | | | | | Do not check for NOT NULL before calling kfree because if the pointer is NULL, no action occurs. Done using the following semantic patch by coccinelle. @@ expression ptr; @@ - if (ptr != NULL) kfree(ptr); Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: Convert timers to use timer_setup()Kees Cook2017-11-034-25/+38
| | | | | | | | | | | | | | | | | | | | | | | | | In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. This performs some refactoring to remove needless wrapper functions, and adds a pointer back to the desired adapter. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Shreeya Patel <shreeya.patel23498@gmail.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Himanshu Jha <himanshujha199640@gmail.com> Cc: Joe Perches <joe@perches.com> Cc: Derek Robson <robsonde@gmail.com> Cc: Harsha Sharma <harshasharmaiitr@gmail.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Stephen Hemminger <stephen@networkplumber.org> Cc: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn> Cc: Johannes Berg <johannes.berg@intel.com> Cc: devel@driverdev.osuosl.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: Fix checkpatch.pl errorSidong Yang2017-11-031-3/+3
| | | | | | | Replaces spaces to tabs for indent. Signed-off-by: Sidong Yang <realwakka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: hide "nolinked power save" info when not debuggingIcenowy Zheng2017-10-181-2/+2
| | | | | | | | | | | | | Currently the rtl8723bs driver will print "nolinked power save enter" and "nolinked power save leave" per minute if it's not connected to any network. These messages are meaningless and annoying to regular users. Hide them when it's not debugging. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: rtw_mlme_ext: mark expected switch fall-throughGustavo A. R. Silva2017-10-181-1/+1
| | | | | | | | In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: remove implicit int->bool conversionsAishwarya Pant2017-10-181-4/+9
| | | | | | | | | | | Implicit type conversions are bad; they hinder readability of code and have potential to cause bugs. Here the variable wait_ack is always supplied a bool value while in function declarations it is defined as an int type. Fix it by defining wait_ack a bool type in all usages. Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: rename camelcase bAcceptAddbaReqAastha Gupta2017-10-184-8/+10
| | | | | | | | | | bAcceptAddbaReq uses camelcase which is not according to Linux kernel coding style. There is a 'bAcceptAddbaReq' field both in struct mlme_ext_info and in struct registry_priv.Rename both of them. Signed-off-by: Aastha Gupta <aastha.gupta4104@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: Change type to boolAastha Gupta2017-10-181-4/+4
| | | | | | | | res and Match have only either 'true' or 'false' values. So making them of type bool for better readability of code. Signed-off-by: Aastha Gupta <aastha.gupta4104@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: remove unused variablesAastha Gupta2017-10-181-4/+0
| | | | | | | | It seems these two operations are just dead code. The values of these variables are not used subsequently. Signed-off-by: Aastha Gupta <aastha.gupta4104@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: remove ternary operators in assignmet statmentsAastha Gupta2017-10-181-2/+3
| | | | | | | | | | | | | | | | | | Remove unnecessary ternary operators in assignments statments. This patch is with the help of following Coccinelle script: @@ expression a, b, c; binary operator op = {==, !=, <=, >=, <, >, &&, ||}; @@ c = - (a op b) ? true : false + a op b Signed-off-by: Aastha Gupta <aastha.gupta4104@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rtl8723bs: core: rtw_cmd: Remove cast to pointer types in kfreeSrishti Sharma2017-10-181-30/+30
| | | | | | | | | | | | | | | | | | | | The cast to pointer types in kfree is not needed and can be dropped. This was done using the following semantic patch by coccinelle, except kfree((unsigned char*) pcmd->parmbuf) which was transformed by hand because coccinelle didn't have enough type information. @r@ type T,P; T* x; @@ kfree( -(P *) x ) Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge 4.14-rc4 into staging-nextGreg Kroah-Hartman2017-10-091-2/+1
|\ | | | | | | | | | | We want the staging/iio fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: rtl8723bs: avoid null pointer dereference on pmlmeprivColin Ian King2017-09-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a check to see if pmlmepriv is null before vfree'ing pmlmepriv->free_bss_buf hence implying pmlmepriv could potenially be null. However, a previous call to rtw_free_mlme_priv_ie_data can also dereference pmlmepriv, so move this call so that it is only called if pmlmepriv non-null. Detected by CoverityScan, CID#1077739 ("Dereference before null check") 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>
* | staging: rtl8723bs: use ARRAY_SIZEJérémy Lefaure2017-10-032-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the ARRAY_SIZE macro improves the readability of the code. Also, it is not always useful to use a variable to store this constant calculated at compile time. Found with Coccinelle with the following semantic patch: @r depends on (org || report)@ type T; T[] E; position p; @@ ( (sizeof(E)@p /sizeof(*E)) | (sizeof(E)@p /sizeof(E[...])) | (sizeof(E)@p /sizeof(T)) ) Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Staging: rtl8723bs: Remove unnecessary commentsShreeya Patel2017-10-035-15/+0
| | | | | | | | | | | | | | | | | | Remove unnecessary comments which are there to explain why call to memset is in comments. Both of the comments are not needed as they are not very useful. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Staging: rtl8723bs: core: Remove boolean comparisonGeorgiana Chelu2017-09-261-32/+32
| | | | | | | | | | | | | | | | | | | | Remove comparison to bool in order to improve the clearness of the code. Issue found using coccinelle script. Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: rtl8723bs: Remove unnecessary rtw_z?malloc castsJoe Perches2017-09-177-73/+71
| | | | | | | | | | | | | | These functions now return void * and no longer need casts. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: rtl8723bs: Convert LIST_CONTAINOR to use kernel container_ofJoe Perches2017-09-172-8/+8
|/ | | | | | | | | | | These are similar macros so use the normal kernel one. As well, there are odd games being played with casting a plist to a union recv_frame by using LIST_CONTAINOR. Just use a direct cast to union recv_frame instead. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: core: remove cast to void pointerHimanshu Jha2017-08-295-5/+5
| | | | | | | | casting to void pointer from any pointer type and vice-versa is done implicitly and therefore casting is not needed in such a case. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: remove memset before memcpyHimanshu Jha2017-08-282-3/+0
| | | | | | | | | | calling memcpy immediately after memset with the same region of memory makes memset redundant. Build successfully. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/rtl8723bs: Fix some coding style issues in rtw_odm.c.Tom Gardi2017-08-181-17/+21
| | | | | | | | | WARNING: line over 80 characters WARNING: static const char * array should probably be static const char * const CHECK: Unnecessary parentheses around hal_data->odmpriv Signed-off-by: Tom Gardi <gardi@gmx.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rtl8723bs: Do not initialise static to 0.Shreeya Patel2017-07-306-14/+14
| | | | | | | | | | Do not initialise static to 0. Static variables by default initialise to 0. This patch fixes the errors found by checkpatch. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: fix build when DEBUG_RTL871X is definedStefan Assmann2017-07-301-2/+1
| | | | | | | | | | | | | Defining DEBUG_RTL871X in rtw_debug.h causes the following compile error: CC [M] drivers/staging/rtl8723bs/core/rtw_mlme.o In file included from drivers/staging/rtl8723bs/core/rtw_mlme.c:18:0: drivers/staging/rtl8723bs/core/rtw_mlme.c: In function ‘rtw_restruct_sec_ie’: drivers/staging/rtl8723bs/core/rtw_mlme.c:2502:19: error: ‘ndissecuritytype’ undeclared (first use in thisfunction) Remove the no longer existing parameter. Signed-off-by: Stefan Assmann <sassmann@kpanic.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: rtw_efuse: Fix a misspellXaralampos Mainas2017-07-301-1/+1
| | | | | | | Fix a comment misspell Signed-off-by: Xaralampos Mainas <xmrancho@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: Place constant at the right.Shreeya Patel2017-07-161-1/+1
| | | | | | | | | | Move constant to the right of a relational operator. This coding style is more common for the kernel code. Problem found by checkpatch. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rtl8723bs: core: rtw_mlme: Fix spelling issuesAmmly Fredrick2017-05-161-14/+14
| | | | | | | Fixed spelling warnings produced by scripts/checkpatch.pl Signed-off-by: Ammly Fredrick <ammlyf@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8188eu, rtl8723bs: fix spelling mistake "Cancle" -> "Cancel"Colin Ian King2017-05-151-2/+2
| | | | | | | Trivial fix to spelling mistakes in a comments and RT_TRACE text. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: declare private function as staticKenneth Hsu2017-04-281-1/+2
| | | | | | | | This fixes a sparse warning regarding an undeclared symbol. Since the function is private to rtw_recv.c, it should be declared as static. Signed-off-by: Kenneth Hsu <kennethhsu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: rework debug configuration handlingArnd Bergmann2017-04-283-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I ran into this warning during randconfig testing: drivers/staging/rtl8723bs/os_dep/rtw_proc.c: In function 'rtw_adapter_proc_deinit': drivers/staging/rtl8723bs/os_dep/rtw_proc.c:738:25: error: unused variable 'drv_proc' [-Werror=unused-variable] drivers/staging/rtl8723bs/os_dep/rtw_proc.c: In function 'rtw_adapter_proc_replace': drivers/staging/rtl8723bs/os_dep/rtw_proc.c:762:25: error: unused variable 'drv_proc' [-Werror=unused-variable] The problem is that the code procfs code gets built even when CONFIG_PROC_FS is disabled, but some functions are turned into empty stubs then. This is easily addressed by adding an #ifdef around the definition of the CONFIG_PROC_DEBUG macro. However, I could not bear looking at the macro name that clashes with the Kconfig name space, so I also renamed it to simply PROC_DEBUG, along with the other rtl8723bs specific CONFIG_DEBUG_* macros that I renamed the same way. This is consistent with how we handle the same checks in the non-staging rtlwifi driver. As the code path for !CONFIG_PROC_DEBUG had not been tested properly, it turned out to be incorrect and requires adding 'static inline' annotations for the stub handlers, and moving some variables around. Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: clean up identical code on an if statementColin Ian King2017-04-181-5/+1
| | | | | | | | | | | | The two different paths for an if statement are identical and hence we can just replace it with the single statement. Detected by CoverityScan, CID#1428443 ("Identical code for different branches") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: remove redundant comparisons of unsigned ints with >= 0Colin Ian King2017-04-181-3/+3
| | | | | | | | | | | The comparison of mode >= 0 is redundant as mode is a u32 and this is always true. Remove this redundant code. Detected with CoverityScan ("Unsigned compared against 0") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: fix spelling mistakes in RT_TRACE messagesColin Ian King2017-04-112-2/+6
| | | | | | | | Fix a few spelling mistakes in RT_TRACE messages and split up wide lines to span multiple lines Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: Add missing include <linux/of.h> to fix compile errorHans de Goede2017-04-111-1/+1
| | | | | | | | | | | | As reported by Stephen Rothwell when merging staging-next, drivers/staging/rtl8723bs/core/rtw_ieee80211.c does not compile due to of_get_property not being declared. Explicitly include <linux/of.h> to fix this compile error. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: core: rtw_cmd: drop unneeded null testsJulia Lawall2017-04-091-4/+2
| | | | | | | | | | | kfree returns immediately on NULL so the tests are not needed. Generated by: scripts/coccinelle/free/ifnullfree.cocci CC: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: core: rtw_cmd: drop unneeded null testJulia Lawall2017-04-091-2/+1
| | | | | | | | | | | kfree returns immediately on NULL so the tests are not needed. Generated by: scripts/coccinelle/free/ifnullfree.cocci CC: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: Fix indenting error in core/rtw_pwrctrl.cLarry Finger2017-04-091-1/+1
| | | | | | | | | | Smatch reports the following: CHECK drivers/staging/rtl8723bs/core/rtw_pwrctrl.c drivers/staging/rtl8723bs/core/rtw_pwrctrl.c:641 LeaveAllPowerSaveModeDirect() warn: inconsistent indenting Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: Fix indenting problems in core/rtw_odm.cLarry Finger2017-04-091-4/+6
| | | | | | | | | | | Smatch reports the following: CHECK drivers/staging/rtl8723bs/core/rtw_odm.c drivers/staging/rtl8723bs/core/rtw_odm.c:109 rtw_odm_dbg_comp_msg() warn: if statement not indented drivers/staging/rtl8723bs/core/rtw_odm.c:146 rtw_odm_ability_msg() warn: if statement not indented Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: Fix indenting errors and an off-by-one mistake in ↵Larry Finger2017-04-091-13/+12
| | | | | | | | | | | | | | | | | | | | | | | core/rtw_mlme_ext.c Smatch lists the following: CHECK drivers/staging/rtl8723bs/core/rtw_mlme_ext.c drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:525 _mgt_dispatcher() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1595 OnAssocReq() error: buffer overflow 'pstapriv->sta_aid' 32 <= 32 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2391 dump_mgntframe_and_wait() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2420 dump_mgntframe_and_wait_ack() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:4969 process_80211d() error: testing array offset 'i' after use. drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:5738 linked_status_chk() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:6459 sitesurvey_cmd_hdl() warn: inconsistent indenting The indenting problems were fixed with white-space changes. The error at line 1595 was the result of an off-by-one error in a for loop. The error at line 4969 was not fixed as that code lies inside a block of code that only is needed for 5G channels. This chip only works at 2.4 GHz. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: Fix white-space errors in core/rtw_recv.cLarry Finger2017-04-091-13/+8
| | | | | | | | | | | | Smart reports the following: CHECK drivers/staging/rtl8723bs/core/rtw_recv.c drivers/staging/rtl8723bs/core/rtw_recv.c:598 portctrl() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_recv.c:838 sta2sta_data_frame() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_recv.c:1547 validate_recv_frame() warn: inconsistent indenting Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud