summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
AgeCommit message (Collapse)AuthorFilesLines
2021-04-09staging: rtl8712: remove struct rtl_ieee80211_ht_cap and ieee80211_ht_addt_infoChristophe JAILLET1-3/+3
struct 'ieee80211_ht_addt_info' is unused and can be removed. struct 'rtl_ieee80211_ht_cap' can be replaced by 'ieee80211_ht_cap' defined in <linux/ieee80211.h> which has the same layout. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/4291cb10744457cc12c89fc9fd414c37d732bc9d.1617911201.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07staging: rtl8712: Use constants from <linux/ieee80211.h>Christophe JAILLET1-4/+4
Some constants defined in wifi.h are already defined in <linux/ieee80211.h> with some other (but similar) names. Be consistent and use the ones from <linux/ieee80211.h>. The conversions made are: _SSID_IE_ --> WLAN_EID_SSID _SUPPORTEDRATES_IE_ --> WLAN_EID_SUPP_RATES _DSSET_IE_ --> WLAN_EID_DS_PARAMS _IBSS_PARA_IE_ --> WLAN_EID_IBSS_PARAMS _ERPINFO_IE_ --> WLAN_EID_ERP_INFO _EXT_SUPPORTEDRATES_IE_ --> WLAN_EID_EXT_SUPP_RATES _HT_CAPABILITY_IE_ --> WLAN_EID_HT_CAPABILITY _HT_EXTRA_INFO_IE_ --> WLAN_EID_HT_OPERATION (not used) _HT_ADD_INFO_IE_ --> WLAN_EID_HT_OPERATION _VENDOR_SPECIFIC_IE_ --> WLAN_EID_VENDOR_SPECIFIC _RESERVED47_ --> (not used) Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/fe35fb45323adc3a30f31b7280cec7700fd325d8.1617741313.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-06staging: rtl8712: remove extra blank linesZhansaya Bagdauletkyzy1-2/+0
Remove extra blank lines to conform with Linux kernel coding style. Reported by checkpatch. Signed-off-by: Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com> Link: https://lore.kernel.org/r/0bf3df788ca46a59ebb990bf2e3effca7080fd1e.1617697237.git.zhansayabagdaulet@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-06staging: rtl8712: add spaces around operatorsZhansaya Bagdauletkyzy1-2/+2
Add spaces around operators to adhere to Linux kernel coding style. Reported by checkpatch. Signed-off-by: Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com> Link: https://lore.kernel.org/r/1fa63e851a6fa403798b95b64d9147c9b3b02c93.1617697237.git.zhansayabagdaulet@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10staging: rtl8712: unterminated string leads to read overflowDan Carpenter1-1/+1
The memdup_user() function does not necessarily return a NUL terminated string so this can lead to a read overflow. Switch from memdup_user() to strndup_user() to fix this bug. Fixes: c6dc001f2add ("staging: r8712u: Merging Realtek's latest (v2.6.6). Various fixes.") Cc: stable <stable@vger.kernel.org> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/YDYSR+1rj26NRhvb@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-04staging: rtl8712: Switch from strlcpy to strscpyKumar Kartikeya Dwivedi1-1/+1
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-12-memxor@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-22staging: rtl8712: clean up comparsions to NULLMichael Straube1-8/+8
Clean up comparsions to NULL Reported by checkpatch. if (x == NULL) -> if (!x) if (x != NULL) -> if (x) Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20200919085032.32453-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-29Staging: rtl8712: Fixed a coding sytle issueAnkit Baluni1-2/+1
Removed braces for a 'if' condition as it contain only single line & there is no need for braces for such case according to coding style rules. Signed-off-by: Ankit Baluni <b18007@students.iitmandi.ac.in> Link: https://lore.kernel.org/r/20200729074541.1972-1-b18007@students.iitmandi.ac.in Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03staging: rtl8712: Replace FIELD_OFFSET() with offsetof()Mauro Dreissig1-2/+2
Use the existing offsetof() macro instead of duplicating code. Signed-off-by: Mauro Dreissig <mukadr@gmail.com> Link: https://lore.kernel.org/r/20200701214420.5566-2-mukadr@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03staging: rtl8712: use common ieee80211 constantsMichael Straube1-1/+1
Many defined constants in wifi.h are unused and/or available from <linux/ieee80211.h>, some with slightly different names. Use the common ones, rename where necessary and remove unused. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20200701164213.4205-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-16staging: rtl8712: switch to common ieee80211 headersPascal Terjan1-8/+5
This patch switches to <linux/ieee80211.h> and <net/cfg80211.h> and deletes a lot of duplicate definitions plus many unused ones. Non obvious changes: - struct ieee80211_ht_cap is different enough that I preferred to keep (and rename) it for now. - mcs_rate in translate_scan was not read after being set, so I deleted that part rather than using the renamed struct - WLAN_CAPABILITY_BSS is replaced with WLAN_CAPABILITY_ESS which is the corresponding one with same value Signed-off-by: Pascal Terjan <pterjan@google.com> Link: https://lore.kernel.org/r/20200609194848.166130-1-pterjan@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-04staging: rtl8712: fix boundary condition for nRohit Sarkar1-2/+2
Now that snprintf is replaced by scnprintf n >= MAX_WPA_IE_LEN doesn't make sense as the maximum value n can take is MAX_WPA_IE_LEN. Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20191002170518.GA1688@SARKAR Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-30staging: rtl8712: Replace snprintf with scnprintfRohit Sarkar1-2/+2
When the number of bytes to be printed exceeds the limit snprintf returns the number of bytes that would have been printed (if there was no truncation). This might cause issues, hence use scnprintf which returns the actual number of bytes printed to buffer always. Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com> Link: https://lore.kernel.org/r/20190910184931.GA8228@SARKAR Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-25staging: rtl8712: r8712_set_802_11_add_wep(): Change return valuesNishka Dasgupta1-3/+2
Change call sites of r8712_set_802_11_add_wep to check for 0 and non-zero values (e.g -EINVAL, -ENOMEM) instead of for _SUCCESS and _FAIL. Change return values of r8712_set_802_11_add_wep from true and false and _SUCCESS to -EINVAL and the return value of r8712_set_key. Change return type from u8 to int to accommodate these new return values. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190722092341.21030-6-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01staging: rtl8712: r8712_parse_wpa2_ie(): Change return valuesNishka Dasgupta1-1/+1
Change return values of function r8712_parse_wpa2_ie from _SUCCESS/_FAIL to 0/-EINVAL. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01staging: rtl8712: r8712_parse_wpa_ie(): Change return valuesNishka Dasgupta1-1/+1
Change return values of function r8712_parse_wpa_ie from _SUCCESS/_FAIL to 0/-EINVAL. Modify call site accordingly. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-28staging: rtl8712: reduce stack usage, againArnd Bergmann1-69/+88
An earlier patch I sent reduced the stack usage enough to get below the warning limit, and I could show this was safe, but with GCC_PLUGIN_STRUCTLEAK_BYREF_ALL, it gets worse again because large stack variables in the same function no longer overlap: drivers/staging/rtl8712/rtl871x_ioctl_linux.c: In function 'translate_scan.isra.2': drivers/staging/rtl8712/rtl871x_ioctl_linux.c:322:1: error: the frame size of 1200 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] Split out the largest two blocks in the affected function into two separate functions and mark those noinline_for_stack. Fixes: 8c5af16f7953 ("staging: rtl8712: reduce stack usage") Fixes: 81a56f6dcd20 ("gcc-plugins: structleak: Generalize to all variable types") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-13staging: rtl8712: Change return values of r8712_setdatarate_cmd()Nishka Dasgupta1-4/+2
Change the return values of function r8712_setdatarate_cmd from _SUCCESS and _FAIL to 0 and -ENOMEM respectively. Change the return type of the function from u8 to int to reflect this. Change the call site of the function to check for 0 instead of _SUCCESS. Return the value at the call site directly instead of storing it in a return variable. Remove now-unused return variable. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30staging: rtl8712: Remove return variable of different typeNishka Dasgupta1-2/+2
The local return variable ret may be replaced directly by its value, especially since its type (uint) is not the same as the function's return type (int). Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8712 - fix up non-kerneldoc commentsValdis Klētnieks1-1/+1
Building with W=1 reports (among other things) CC [M] drivers/staging/rtl8712/rtl871x_ioctl_linux.o drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1106: warning: Cannot understand * on line 1106 - I thought it was a doc line CC [M] drivers/staging/rtl8712/os_intfs.o drivers/staging/rtl8712/os_intfs.c:366: warning: Cannot understand * on line 366 - I thought it was a doc line drivers/staging/rtl8712/os_intfs.c:434: warning: Cannot understand * on line 434 - I thought it was a doc line Fix up the non-kerneldoc comments Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8712: rename bDriverStopped to driver_stoppedHimadri Pandya1-8/+8
- Rename structure field bDriverStopped to driver_stopped to avoid camelcase. Suggested by checkpatch. - Change type to bool as the variable is being used as boolean. Signed-off-by: Himadri Pandya <himadri18.07@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-03staging: rtl8712: add SPDX identifiersMichael Straube1-13/+1
This satisfies a checkpatch warning and is the preferred method for notating the license. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: rtl8712u: Fix compiler warning about strncpyLarry Finger1-1/+1
When strncpy() is called with source and destination strings the same length, gcc 8 warns that there may be an unterminated string. Using strlcpy() rather than strncpy() forces a null at the end and quiets the warning. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-27staging: rtl8712: remove unused array iw_operation_modeColin Ian King1-5/+0
Array iw_operation_mode is defined but is never used hence it is redundant and can be removed. This array has been like this since the driver was added back in 2010 Cleans up clang warning: warning: 'iw_operation_mode' defined but not used [-Wunused-const-variable=] Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-21staging: rtl8712: style fix multiple line dereferencesMartin Homuth1-46/+46
This patch fixes various coding style issues in the rtl8712 module as noted by checkpatch.pl related to dereferencing over multiple lines. It fixes the following checkpatch.pl warning: WARNING: Avoid multiple line dereference - prefer %s Signed-off-by: Martin Homuth <martin@martinhomuth.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19staging: rtl8712: style fix returned error codeMartin Homuth1-1/+1
This patch fixes a coding style issues in the rtl8712 module as noted by checkpatch.pl regarding the returned error code. It fixes the following checkpatch.pl warning: WARNING: ENOSYS means 'invalid syscall nr' and nothing else Signed-off-by: Martin Homuth <martin@martinhomuth.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19staging: rtl8712: style fix indentationMartin Homuth1-6/+6
This patch fixes various coding style issues in the rtl8712 module as noted by checkpatch.pl related to indentation. It fixes the following checkpatch.pl warning: WARNING: suspect code indent for conditional statements Signed-off-by: Martin Homuth <martin@martinhomuth.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-23staging: rtl8712: Invert comparison to reduce indentationNarcisa Ana Maria Vasile1-6/+5
Check the condition: "pdata->length < 32" first, to be able to return immediately in case of error and then continue with the rest of the function without one extra indentation level. This was found using the following Coccinelle script: @disable neg_if@ expression e,E; statement S; @@ *if (e) S else { return -E; } @disable neg_if@ expression e,E; statement S; identifier l; @@ *if (e) S else { rc = -E; goto l; } Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-23staging: rtl8712: Restructure code for clarityNarcisa Ana Maria Vasile1-36/+33
Invert if statements to be able to return immediately in case of error, and to avoid additional else branch. Improve layout of function since there is more horizontal space now. This was found using the following Coccinelle script: @disable neg_if@ expression e,E; statement S; @@ *if (e) S else { return -E; } @disable neg_if@ expression e,E; statement S; identifier l; @@ *if (e) S else { rc = -E; goto l; } Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-23staging: rtl8712: Invert the test on check_fwstate() to reduce indentationNarcisa Ana Maria Vasile1-7/+7
Negate if condition to be able to return immediately in case of error, and then continue with the rest of the function without extra indentation level. This was found using the following Coccinelle script: @disable neg_if@ expression e,E; statement S; @@ *if (e) S else { return -E; } @disable neg_if@ expression e,E; statement S; identifier l; @@ *if (e) S else { rc = -E; goto l; } Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-23staging: rtl8712: Invert if statements to reduce indentation levelNarcisa Ana Maria Vasile1-22/+17
Invert if statements to be able to return immediately in case of error, and to avoid additional else branch, and then continue with the rest of the function without excessive indentation. This was found using the following Coccinelle script: @disable neg_if@ expression e,E; statement S; @@ *if (e) S else { return -E; } @disable neg_if@ expression e,E; statement S; identifier l; @@ *if (e) S else { rc = -E; goto l; } Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: rtl8712: Fix checkpatch.pl warningAlexander Mikhalevich1-4/+4
WARNING: Avoid multiple line dereference - prefer 'param->u.crypt.key' Signed-off-by: Alexander Mikhalevich <alex.mikhalevich@gmail.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12staging: r8712u: Fix Sparse warnings in rtl871x_ioctl_linux.cLarry Finger1-2/+2
Sparse reports the following: CHECK drivers/staging/rtl8712/rtl871x_ioctl_linux.c drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1422:46: warning: restricted __le16 degrades to integer drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1424:46: warning: restricted __le16 degrades to integer Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-25Staging: rtl8712: fix spelling errorsJoseph Wright1-1/+1
Found by checkpatch: - s/cacluated/calculated/ - s/convertor/converter/ - s/psudo/pseudo/ - s/halfs/halves/ Signed-off-by: Joseph Wright <rjosephwright@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: fixed little endian problemJannik Becher1-1/+1
Fixed a sparse warning. Using function le16_to_cpus() to avoid double assignment. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21Staging: rtl8712: rtl871x_*: Removed unnecessary else statements after a ↵Shiva Kerdel1-2/+2
break or return The indent code blocks of the else statements were unnecessary and are better written without them. Signed-off-by: Shiva Kerdel <shiva@exdev.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13staging: rtl8712: fix coding style error reported from checkpatchOmri Arad1-2/+2
removed the following: ERROR: code indent should use tabs where possible WARNING: please, no spaces at the start of a line WARNING: Statements should start on a tabstop Signed-off-by: Omri Arad <omriarad3@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: rtl8712: use container_of() instead of LIST_CONTAINOR()Geliang Tang1-6/+6
This patch drops the local definition of LIST_CONTAINOR(), and uses container_of() instead of it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: rtl8712: rtl871x_ioctl_linux: Clean up tests if NULL returned on ↵Bhaktipriya Shridhar1-2/+2
failure Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...); ... - e == NULL + !e Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-05rtl871x: avoid running off end of bufferAlan1-1/+2
If 32 bytes of non zero are passed in pdata->pointer then the mac_pton function will run off the end of the buffer. Make sure we always have a terminated string kernel side. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20staging: rtl8712: reduce stack usageArnd Bergmann1-1/+1
The "translate_scan" function in rtl8712 uses a lot of stack, and gets inlined into its single caller, r8711_wx_get_scan, which in some configurations now blows the 1024 byte stack warning limit: drivers/staging/rtl8712/rtl871x_ioctl_linux.c: In function 'r8711_wx_get_scan': drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1227:1: error: the frame size of 1032 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] This somewhat reduces the stack usage by moving the translate_scan function out of line with the noinline_for_stack annotation. It might be possible to modify translate_scan() a little further to reduce the stack usage, but with this patch, we can build without the warning, the the call chain to get here is rather predictable (sys_ioctl->vfs_ioctl->sock_ioctl->dev_ioctl->wext_ioctl-> r8711_wx_get_scan). Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: rtl8712: memory corruption in wpa_set_encryption()Dan Carpenter1-4/+1
->KeyMaterial is declared as a 16 byte array, but we only ever allocate either 5 or 13 bytes of it. The problem is that we memset() all 16 bytes to zero so we're memsetting past the end of the allocated memory. I fixed this in slightly lazy way, by just allocating 16 bytes. This works but there is a lot more cleanup you could do to this code if you wanted. Which is why this code is in staging. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: rtl8712: spaces preferred around operandsLuis de Bethencourt1-22/+25
Clean up all instances of checkpatch.pl checks: CHECK: spaces preferred around that '+' (and other operands) Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: rtl8712: braces should be used on all armsLuis de Bethencourt1-20/+30
Fix all instances of the following checkpatch.pl check: CHECK: braces {} should be used on all arms of this statement Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: rtl8712: Remove boolean comparisonsLuis de Bethencourt1-28/+28
Boolean tests do not need explicit comparison to true or false. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16Staging: rtl8712: Coding style warnings fix for block commentsPunit Vara1-11/+15
This patch is to the rtl871x_ioctl_linux.c file that fixes up following warnings reported by checkpatch.pl : -Block comments use * on subsequent lines -Block comments use a trailing */ on a separate line Signed-off-by: Punit Vara <punitvara@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16Staging: rtl8712: Use ether_addr_equal() over memcmp()Punit Vara1-1/+1
This patch is to the rtl871x_ioctl_linux.c file that fixes up following warning reported by checkpatch.pl : -Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp() bssid and pnetwork->network.MacAddress both are 6 byte array which aligned with u16 Signed-off-by: Punit Vara <punitvara@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16Staging: rtl8712: Fix warning prefer eth_broadcast_addr() over memset()Punit Vara1-2/+1
This patch is to the rtl871x_ioctl_linux.c that fixes up following warning by checkpatch.pl: -Prefer eth_broadcast_addr() over memset() Signed-off-by: Punit Vara <punitvara@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: rtl8712: fix negative level valueLuis de Bethencourt1-1/+1
range->avg_qual.level is of type uint8, so it shouldn't be assigned a negative number. Assigning it 0x100 - 78, which is the equivalent to (20 + -98) dBm when IW_QUAL_DBM is set. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08staging: rtl8712: Move constant to right of test or replace with "!"Alison Schofield1-10/+10
Move constant to the right side of comparison operator or replace equality operator (==) with the unary negation operator (!) if the comparison is to zero. Addesses multiple instances of the checkpatch.pl warning: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Alison Schofield <amsfield22@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>