summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8712
AgeCommit message (Collapse)Author
2016-05-01rtl8712: Fixed alignment to match open parenthesisParth Sane
Fixed alignment to match open parenthesis. Signed-off-by: Parth Sane <laerdevstudios@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-30staging: rtl8712: use container_of() instead of LIST_CONTAINOR()Geliang Tang
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: mlme_linux: Clean up tests if NULL returned on failureBhaktipriya Shridhar
Some functions like 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-28staging: rtl8712: Fixed FSF address warning in ieee80211.cParth Sane
Fixed checkpatch warning after removing FSF address block as per guidelines. Signed-off-by: Parth Sane <laerdevstudios@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: rtl8712: Fixed FSF address warning in hal_init.cParth Sane
Fixed checkpatch warning after removing FSF address block as per guidelines. Signed-off-by: Parth Sane <laerdevstudios@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: rtl8712: Fixed FSF address warning in ethernet.hParth Sane
Fixed checkpatch warning after removing FSF address block as per guidelines. Signed-off-by: Parth Sane <laerdevstudios@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: rtl8712: Fixed FSF address warning in drv_types.hParth Sane
Fixed checkpatch warning after removing FSF address block as per guidelines. Signed-off-by: Parth Sane <laerdevstudios@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: rtl8712: Fixed FSF address warning in basic_types.hParth Sane
Fixed checkpatch warning after removing FSF address paragraph as per guidelines. Signed-off-by: Parth Sane <laerdevstudios@gmail.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 Shridhar
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-28staging: rtl8712: rtl871x_cmd: Clean up tests if NULL returned on failureBhaktipriya Shridhar
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-28staging: rtl8712: rtl871x_mlme: Clean up tests if NULL returned on failureBhaktipriya Shridhar
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-28staging: rtl8712: usb_ops_linux: Clean up tests if NULL returned on failureBhaktipriya Shridhar
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-28staging: rtl8712: os_intfs: Change form of NULL comparisonsBhaktipriya Shridhar
Change null comparisons of the form x == NULL to !x. This was done using Coccinelle. @@ expression e; @@ - e == NULL + !e Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: rtl8712: rtl871x_ioctl_set: Remove unused macroBhaktipriya Shridhar
Removed Unused macro IS_MAC_ADDRESS_BROADCAST. Grep'd to find occurences. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: rtl8712: rtl8712_cmd.c: fixed comparison to nullJuliana Rodrigues
This patch fixes multiple "comparison to NULL" checkpatch.pl issues: CHECK: Comparison to NULL could be written "!pcmd" + if (pcmd == NULL) Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: rtl8712: hal_init.c: fix comment block code styleJuliana Rodrigues
This patch fixes several warnings caused by malformed comments on hal_init.c and found by checkpatch.pl. Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-23staging: refresh TODO for rtl8712Xose Vazquez Perez
People should not waste time and energy working on this staging driver. At least four drivers were written for this hardware: https://marc.info/?l=linux-wireless&m=138358275410975 And there is a replacement using the kernel wireless stack at: https://github.com/chunkeey/rtl8192su Also a fullmac/cfg80211 driver(r92su) is available. Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com> Cc: Christian Lamparter <chunkeey@googlemail.com> Cc: Joshua Roys <Joshua.Roys@gtri.gatech.edu> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Linux Driver Project Developer List <driverdev-devel@linuxdriverproject.org> Cc: Linux Wireless <linux-wireless@vger.kernel.org> Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12Staging: rtl8712: Remove function r8712_setptm_cmd and r8712_gettssi_cmdBhumika Goyal
The function r8712_setptm_cmd and r8712_gettssi_cmd are not used anywhere in the kernel so remove them. Also, remove their function prototypes. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rtl8712: Remove unnecessary else after returnBhaktipriya Shridhar
This patch fixes the checkpatch warning that else is not generally useful after a break or return. This was done using Coccinelle: @@ expression e2; statement s1; @@ if(e2) { ... return ...; } -else s1 Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12Staging: rtl8712: Avoid multiple assignments.Sandhya Bankar
Avoid multiple assignments.This isssue is found by checkpatch.pl script. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rtl8712: Remove the unnecessary paranthesesG Pooja Shamili
The unnecessary parantheses on the right side of assignments were removed, as in most cases (expect for ==, >=, <=, !=), they are futile. This was done using Coccinelle, the semantic patch being: @@ expression E1,E2,E3; binary operator bin_op = {==,>=,<=,!=}; @@ E1 = ( ( E2 bin_op E3 ) | -( E2 -) ) ; Signed-off-by: G Pooja Shamili <poojashamili@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rtl8712: rtl871x_mp_ioctl: Remove exceptional & on function nameAmitoj Kaur Chawla
In this file, function names are otherwise used as pointers without &. The Coccinelle semantic patch that is used to make this change is as follows: // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f @m@ type T; identifier f; @@ T f(...); @@ identifier m.f; @@ - &f + f // </smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12drivers: staging: rtl8712: Change form of NULL comparisonsBhaktipriya Shridhar
Change null comparisons of the form x == NULL to !x. This was done using Coccinelle. @@ expression e; @@ - e == NULL + !e Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rtl8712: Make return of 0 explicitBhaktipriya Shridhar
Delete unnecessary local variable whose value is always 0 and return 0 as the result. The following Coccinelle script was used: @@ identifier ret; expression E; type T; @@ ( - T ret; | - T ret = 0; ) ... when != \(ret=E \|ret--\|ret++\|--ret\|++ret\|ret-=E\|ret+=E\|ret|=E\|ret&=E\) ( ?-ret = 0; ) ... when != \(ret=E \|ret--\|ret++\|--ret\|++ret\|ret-=E\|ret+=E\|ret|=E\|ret&=E\) ( return - ret + 0 ; ) Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12Staging: rtl8712: Clean up tests if NULL returned on failureBhumika Goyal
Some functions like kmalloc/usb_alloc_urb/kmalloc_array returns NULL as their return value on failure. !x is generally preferred over x==NULL or NULL==x so make use of !x if the value returned on failure by these functions is NULL. Done using coccinelle: @@ expression e; statement S; @@ e = \(kmalloc\|devm_kzalloc\|kmalloc_array \|devm_ioremap\|usb_alloc_urb\|alloc_netdev\)(...); - if(e==NULL) + if(!e) S Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rtl8712: Remove unnecessary paranthesesBhaktipriya Shridhar
Removed parantheses on the right hand side of assignments as they are not needed. This was done with Coccinelle: @@ expression a, b; @@ a = - ( b - ) ; Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rtl8712: Simplify returnBhaktipriya Shridhar
Simplified the multiline check to a single return statement. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rtl8712: Remove exceptional & on function nameAmitoj Kaur Chawla
Remove exceptional '&' operator in front of a function name. The Coccinelle semantic patch that is used to make this change is as follows: // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f @m@ type T; identifier f; @@ T f(...); @@ identifier m.f; @@ - &f + f // </smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rtl8712: Remove unnecessary cast on void pointerBhaktipriya Shridhar
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rtl8712: Remove cast on void pointerBhaktipriya Shridhar
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-05drivers: staging: rtl8712: rtl871x_xmit.c: Fix Comparisons should place the ↵Tapan Prakash T
constant on the right side of the test warning Fixed checkpatch.pl warning 'Comparisons should place the constant on the right side of the test' Signed-off-by: Tapan Prakash T <tapanprakasht@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-05rtl871x: avoid running off end of bufferAlan
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: Replace explicit NULL comparisonBhaktipriya Shridhar
Replace explicit NULL comparison with ! operator. Found with Coccinelle. @@ expression e; @@ - e == NULL + !e Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20staging: rtl8712: reduce stack usageArnd Bergmann
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-20staging: rtl8712: Improve suspend/resume functionality.Hemmo Nieminen
Fix a driver hang caused by earlier suspend/resume cycles. By handling a ENODEV error during suspend as a real error we eventually end up stopping the whole driver. Fix this by handling the ENODEV error (during suspend) essentially by retrying. Signed-off-by: Hemmo Nieminen <hemmo.nieminen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20staging: rtl8712: Declare function as staticAmitoj Kaur Chawla
Declare rtl871x_intf_resume() function static since it is defined and called in this file only. This fixes the following sparse warning: warning: symbol 'rtl871x_intf_resume' was not declared. Should it be static? Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15staging: rtl8712: Remove unnecessary ret variableJoseph Bisch
Since the variable ret is set at the beginning of the function and never changes its value, we can just return the value it was set to. Found using coccinelle with misc/returnvar.cocci. Signed-off-by: Joseph Bisch <joseph.bisch@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15staging: rtl8712: Fixed a comparision coding style warning.Rakhi Sharma
WARNING: Comparisons should place the constant on the right side of the test Fixed this warning by placing the constant on right side. Signed-off-by: Rakhi Sharma <rakhish1994@gmail.com>- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: rtl8712: use list_first_entry_or_null()Geliang Tang
Use list_first_entry_or_null() instead of list_empty() + LIST_CONTAINOR() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08Staging: rtl8712: rtl8712_cmd: Fixed a warning.Rakhi Sharma
Warning:Comparisons should place the constant on the right side of the test Fixed by placing the comparisions constant on right side of the test. Signed-off-by: Rakhi Sharma <rakhish1994@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: rtl8712: memory corruption in wpa_set_encryption()Dan Carpenter
->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>
2016-02-08Staging: rtl8712: Remove unnecessary cast on void pointerLucas Tanure
The conversion from void pointer to any other pointer type is guaranteed by the C programming language. The semantic patch used to find this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Lucas Tanure <tanure@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: rtl8712: consolidate kmalloc + memset 0 to kzallocNicholas Mc Guire
This is an API consolidation only. The use of kmalloc + memset to 0 here is equivalent to kzalloc. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: rtl8712: Improve suspend/resume functionality.Hemmo Nieminen
Cancel pending URBs during suspend operation to avoid receiving ESHUTDOWN in read/write completion callbacks while the device is suspended. Receiving ESHUTDOWN in read/write completion callbacks will cause the driver to enter a non-functioning "stopped" state from which the driver is unable to recover without reloading the module. Signed-off-by: Hemmo Nieminen <hemmo.nieminen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: rtl8712: Cleanup _io_ops wrappersMauro Dreissig
This removes ugly and unnecessary declarations. Signed-off-by: Mauro Dreissig <mukadr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: rtl8712: Remove unused CamelCase defineMichael Hornung
* Remove unused CamelCase in order to get rid of the corresponding checkpatch.pl "CHECK: Avoid CamelCase: <IEEE80211_QoS_DATAGRP>" Signed-off-by: Michael Hornung <mhornung.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: rtl8712: Coding style: Fix alignmentMichael Hornung
* Fix alignment which did not match open parenthesis Signed-off-by: Michael Hornung <mhornung.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: rtl8712: Replace FSF mailing address by URLMichael Hornung
* Fix checkpatch.pl output about not including the paragraph about writing to the Free Software Foundation's mailing address Signed-off-by: Michael Hornung <mhornung.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: rtl8712: Coding style: Fix missing spacesMichael Hornung
* Add missing spaces around bitwise OR operation in order to get rid of checkpatch.pl's "CHECK: spaces preferred around that '|'" Signed-off-by: Michael Hornung <mhornung.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: rtl8712: Coding style: Make use of BIT macroMichael Hornung
* Replace all occurences of (1<<x) by BIT(x) in order to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro" Signed-off-by: Michael Hornung <mhornung.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>