summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2017-09-18Staging: rtl8723bs/os_dep: Remove typecast in kfreeMeghana Madhyastha
Remove typecast of pointer in kfree((u8 *)pdvobj) as it is not needed. Found using the following Coccinelle semantic patch: @@ identifier x; type t; @@ -kfree((t *)x) +kfree(x) Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18staging: rtl8723bs: Merge assignment with returnHarsha Sharma
Merge assignment with return statement to directly return the value. Done using following coccinelle semantic patch @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18Staging: irda: Use !x instead of NULL comparisonSrishti Sharma
Test for NULL as !x where functions that return NULL on failure are used. Done using the following semantic patch by coccinelle. @ is_null @ expression E; statement S; @@ E = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\| usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...)); ( if(!E) S | -if(E==NULL) +if(!E) S ) 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>
2017-09-18Staging: irda: drivers: Move the curly bracket to the same line as ifMeghana Madhyastha
Move the left curly brace to the same line as the if statement. This coding style is more common and also reduces the number of lines of code. Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18Staging: irda: Remove parentheses on the right of assignmentSrishti Sharma
Parentheses are not needed on the right hand side of assignment statement in most cases. Done using the following semantic patch by coccinelle. @@ identifier E,F,G,f; expression e,r; @@ ( E = (G == F); | E = (e == r); | E = -( ... -) ; ) Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18Staging: irda: Don't use assignment inside if statementSrishti Sharma
Write assignment statement outside of the if statement. Done using the following semantic patch by coccinelle. @@ identifier E; expression F; statement S; @@ -if((E = F)) +E = F; +if(E) S Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18Staging: irda: drivers: Replace (skb == NULL) with (!skb)Meghana Madhyastha
Some functions return NULL as an indication of failure. The style (!skb) is more common than (skb == NULL) for these functions. Found by the following Coccinelle script. @@ identifier i; statement S; @@ i = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|usb_alloc_urb\| alloc_netdev\|dev_alloc_skb\)(...)); ( -if (i == NULL) +if (!i) S | -if (NULL == i) +if (!i) S ) Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18staging: irda: Remove typedef structHaneen Mohammed
This patch remove typedef from a structure with all its ocurrences since using typedefs for structures is discouraged. Issue found using Coccinelle: @r1@ type T; @@ typedef struct { ... } T; @script:python c1@ T2; T << r1.T; @@ if T[-2:] =="_t" or T[-2:] == "_T": coccinelle.T2 = T[:-2]; else: coccinelle.T2 = T; print T, coccinelle.T2 @r2@ type r1.T; identifier c1.T2; @@ -typedef struct + T2 { ... } -T ; @r3@ type r1.T; identifier c1.T2; @@ -T +struct T2 Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18staging: speakup: remove NULL comparisonAastha Gupta
This was done using cocccinelle script: @@ identifier arg; @@ -arg==NULL +!arg Signed-off-by: Aastha Gupta <aastha.gupta4104@gmail.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18Staging: speakup: Remove print following unsuccessful kmallocMeghana Madhyastha
Remove print statement following unsuccessful kmalloc when there is not enough memory. Kmalloc and variants normally produce a backtrace in such a case. Hence, a print statement is not necessary. Found using the following Coccinelle semantic patch: @@ identifier i; @@ i = (\(kmalloc\|devm_kzalloc\|kmalloc_array\| devm_ioremap\|usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\| kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...)); ( if (i == NULL) { -\(DBG_8723A\|printk\|pr_err\|CERROR\|DBG_88E\)(...); ...when any } | if (!i) { -\(DBG_8723A\|printk\|pr_err\|CERROR\|DBG_88E\)(...); ...when any } ) @@ identifier i; @@ ( - if (i == NULL) { + if (i == NULL) return ...; - } | - if (!i) { + if (!i) return ...; - } ) Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18Staging: dgnc: Remove unused fields in struct channel_tSrishti Sharma
Eliminate the fields that are not used and the comments associated with them. 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>
2017-09-18Staging: dgnc: Remove unused fields in struct dgnc_boardSrishti Sharma
Remove unused fields and comments associated with them in the structure definition. 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>
2017-09-18staging: dgnc: remove variable rcAastha Gupta
Found using coccinelle script: @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: Aastha Gupta <aastha.gupta4104@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18staging: dgnc: remove unused variableAastha Gupta
This patch removes unused variable. Signed-off-by: Aastha Gupta <aastha.gupta4104@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18staging: lustre: lnet: Replace list_for_each with list_for_each_entryHaneen Mohammed
Replace use of the combination of list_for_each and list_entry with list_for_each_entry to simplify the code and remove variables that are used only in list_for_each. Issue found and corrected using Coccinelle script: @r@ expression head, member, e; type T1, T2, T3; iterator name list_for_each, list_for_each_entry; identifier pos, var; @@ -T1 *pos; ...when!=pos=e; -list_for_each(pos, head) +list_for_each_entry(var, head, member) { ...when!=pos=e; when!=T3 *var; -var = list_entry(pos, T2, member); ...when!=pos=e; } ...when!=pos=e; Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18Merge branch 'staging_typec_move' into staging-nextGreg Kroah-Hartman
Move the typec code out of staging into the USB tree. This is on a separate branch so that we can share it with the USB git tree and not cause merge issues later on. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18usb: typec: fusb302: Move out of stagingGuenter Roeck
The driver is in good enough shape to be moved out of staging. Do it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18typec: tcpm: Move out of stagingGuenter Roeck
Move tcpm (USB Type-C Port Manager) out of staging. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18staging: typec: pd: Document struct pd_messageGuenter Roeck
struct pd_message is the format of a PD message as seen on the wire. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18staging: typec: tcpm: Document data structuresGuenter Roeck
Document struct tcpc_config and struct tcpc_dev. Drop unused TCPC_USB_SWITCH_RESTORE. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18staging: typec: tcpm: Drop commented out codeGuenter Roeck
Commented out code can be added as needed. Drop it. Also drop TODO and an obsolete XXX comment. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: wlan-ng: Avoid bogus endiannessAviya Erenfeld
The linkstatus variable in the info struct received as __le16 but handled in every other place in the driver as u16 Fix that and remove the sparse warning that occurred due to it: prism2sta.c:1450:29: warning: incorrect type in assignment (different base types) prism2sta.c:1450:29: expected unsigned short [unsigned] [usertype] link_status_new prism2sta.c:1450:29: got restricted __le16 [usertype] linkstatus Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging:r8192u: replace request_module with try_then_request_moduleIvan Safonov
Return value of request_module() does not handled, so it is possible to use shorter try_then_request_module(). Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8712: Fix unbalanced braces around else statementLiam Ryan
Fix checkpath-reported unbalanced braces in the following areas 221: FILE: drivers/staging/rtl8712/hal_init.c:221: 392: FILE: drivers/staging/rtl8712/os_intfs.c:392: 363: FILE: drivers/staging/rtl8712/rtl8712_cmd.c:363: 889: FILE: drivers/staging/rtl8712/rtl8712_recv.c:889: 902: FILE: drivers/staging/rtl8712/rtl871x_cmd.c:902: 84: FILE: drivers/staging/rtl8712/rtl871x_ioctl_set.c:84: 580: FILE: drivers/staging/rtl8712/rtl871x_mlme.c:580: 593: FILE: drivers/staging/rtl8712/usb_intf.c:593: Signed-off-by: Liam Ryan <liamryandev@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17Staging: ccree: Remove unused variable monitor_lockSrishti Sharma
Remove the variable monitor_lock as it is not used anywhere. Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Acked-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8723bs: Change coding style to (foo *bar)Harsha Sharma
This coding style (foo *bar) is more common for the kernel code. Change foo* bar to foo *bar. Change foo * bar to foo *bar. Change (foo*) to (foo *). Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17Staging: rtlwifi: Remove unnecessary 'out of memory' message.Shreeya Patel
Logging messages that show some type of "out of memory" error are generally unnecessary as there is a generic message and a stack dump done by the memory subsystem. These messages generally increase kernel size without much added value. Problem found by checkpatch. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8723bs: Remove unnecessary spacesHarsha Sharma
Space between function name and open parentheses '(' is prohibited. Space is required around most binary operators '=', '==', '+=', '<', ':', '+', '-' Space required before '&', '*' Space is required after ',', ';' Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: pi433: Replace printk() with dev_dbg()Haneen Mohammed
This patch convert printk() to the preferred variant dev_dbg() and remove unnecessary comment line. Issue detected with checkpatch.pl. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8723bs: Remove unnecessary blank linesHarsha Sharma
Blank lines aren't necessary after an open brace and before a close brace Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8723bs: Remove unneccesary braces and change position of open braceHarsha Sharma
Follow linux-kernel code style for conditional statements Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8723bs: Add space between concatenated stringsHarsha Sharma
Use spaces between concatenated strings Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8723bs: Remove unnecessary spaces at the start of lineHarsha Sharma
No spaces at the start of a line Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8723bs: Add spaces around '?', '==', '||', '!='Harsha Sharma
Use spaces around most binary operators Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8723bs: Add spaces around '+', '|', '*'Harsha Sharma
Use one space around most binary operators Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8723bs: Add spaces around '='Harsha Sharma
Use one space around (on each side of) '=' operator Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: pi433: Fixes minor typo errorsHarsha Sharma
Fixes checkpatch warning -- "occured" and "succesfully" are misspelled Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17Staging: speakup: Replace symbolic permissionMeghana Madhyastha
Replace S_IRUGO by 0444 in module parameter declaration. 0444 is more readable and matches the style used in other declarations nearby. Problem found using checkpatch. Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8723bs: Do not initialise statics to 0Harsha Sharma
Static variables are initialised to 0 by gcc Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8723bs: Remove unnecessary rtw_z?malloc castsJoe Perches
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>
2017-09-17staging: rtl8723bs: convert private allocation functions to return void *Joe Perches
Using char * for a return from allocation functions means the code has to cast generic allocations to specific types. Allow the compiler to not need casts on the allocations. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8723bs: Convert LIST_CONTAINOR to use kernel container_ofJoe Perches
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>
2017-09-17Staging: rtl8712: Remove multiple blank linesSrishti Sharma
Remove extra blank line. 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>
2017-09-17Staging: xgifb: XGI_main_26.c: Fix alignment to match parenthesesSrishti Sharma
Fix alignment so that it matches open parentheses. Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: sm750fb: Remove extra blank linesHarsha Sharma
This was reported by checkpatch.pl Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17Staging: vc04_services: bcm2835-camera: Fix spelling mistakeMeghana Madhyastha
Fixes a spelling mistake in the comments. Problem found using checkpatch. Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtlwifi: remove unused functionsTobin C. Harding
Functions rtl_rfreg_delay() and rtl_bb_delay() are unused within the driver. Both functions call rtl_addr_delay(), this function is unused outside of these call sites.The driver (and kernel) code base is cleaner if unused functions are removed. Remove unused functions. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtlwifi: use kcalloc instead of multiplyTobin C. Harding
checkpatch emits multiple warnings of type WARNING:ALLOC_WITH_MULTIPLY: Prefer kcalloc over kzalloc with multiply Replace two calls to kzalloc() with calls to kcalloc(). Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17Staging: ccree: Merge assignment with returnSrishti Sharma
Merge the assignment and the return statements to return the value directly. Done using coccinelle. @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; 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>
2017-09-17staging: ccree: remove BUG macro usageGilad Ben-Yossef
Replace BUG() macro usage that crash the kernel with alternatives that signal error and/or try to recover. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>