summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2016-03-11staging: rtl8188eu: hal: Drop Useless InitializationBhaktipriya Shridhar
Removed initialisation of a varible if it is immediately reassigned. Changes were made using Coccinelle. @bad@ identifier i; position p; @@ i =@p <+...i...+>; @@ type T; constant C; expression e; identifier i; position p != bad.p; @@ T i - = C ; i =@p e; Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: rtl8188eu: 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-11Staging: sm750fb: Remove unused functionsBhumika Goyal
The functions dviGetDeviceID and dviGetVendorID are not used anywhere in the kernel so remove them. Also, remove their function prototypes. Grepped to find occurences. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11Staging: sm750fb: Remove leading and trailing whitespace.Sandhya Bankar
Remove leading and trailing whitespace. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: sm750fb: convert pr_err() to dev_err()Eva Rachel Retuya
Replace pr_err() calls with respective dev_err() counterpart. Change is safe since pdev is not NULL, this was identified by hand. Semantic patch used to detect and apply the transformation: @r exists@ identifier f,s,i; position p; @@ f(...,struct s *i,...) { <+... pr_err@p(...) ...+> } @s@ identifier r.s, dev; @@ struct s { ... struct device dev; ... }; @t@ identifier r.i, s.dev; expression fmt; position r.p; @@ - pr_err@p( + dev_err(&i->dev, fmt, ...); Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: sm750fb: Remove Unused macroBhaktipriya Shridhar
The macro PEEK32 is used nowhere in the file. Hence,removed. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: sm750fb: Use pcim_enable_device()Amitoj Kaur Chawla
Devm_ functions allocate memory that is released when a driver detaches. Replace pci_enable_device with the managed pcim_enable_device and remove corresponding pci_disable_device from probe and suspend functions of a pci_dev. Also, an unnecessary label has been removed by replacing it with a direct return statement. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: sm750fb: Replace kzalloc with devm_kzallocAmitoj Kaur Chawla
Devm_ functions allocate memory that is released when a driver detaches. Replace kzalloc with devm_kzalloc and remove corresponding kfrees from probe and remove functions of a pci_dev. Also, an unnecessary label has been removed by replacing it with a direct return statement. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: sm750fb: Remove unnecessary pci_set_drvdata()Amitoj Kaur Chawla
Unnecessary pci_set_drvdata() has been removed since the driver core clears the driver data to NULL after device release or on probe failure. There is no need to manually clear the device driver data to NULL. The Coccinelle semantic patch used to make this change is as follows: //<smpl> @@ struct pci_dev *pci; @@ - pci_set_drvdata(pci, NULL); //</smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: sm750fb: Remove parentheses from return argumentsAmitoj Kaur Chawla
Remove unnecessary parentheses from return arguments. The Coccinelle semantic patch that makes this change is as follows: // <smpl> @@ identifier i; constant c; @@ return - ( \(i\|-i\|i(...)\|c\) - ) ; // </smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: most: hdm-usb: Remove invalid reference errorAmitoj Kaur Chawla
commit e3479f77("staging: most: hdm-usb: Remove create_workqueue()") cancel_work_sync(&anchor->clear_work_obj) is introduced after freeing `anchor` causing a invalid reference error. This patch removes this error by shifting the call to cancel_work_sync before freeing `anchor`. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: rts5208: 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-11staging: rts5208: Remove NULL test before vfreeBhaktipriya Shridhar
vfree frees the virtually continuous memory area starting at addr. If addr is NULL, no operation is performed. So NULL test is not needed before vfree. This was done using Coccinelle: @@ expression x; @@ -if (x != NULL) vfree(x); @@ expression x; @@ -if (x != NULL) { vfree(x); x = NULL; -} Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: rts5208: simplify NULL testsEva Rachel Retuya
Replace direct comparisons to NULL i.e. 'x == NULL' with '!x' for consistency. Coccinelle semantic patch used: @@ identifier func; expression x; statement Z; @@ x = func(...); if ( ( + ! x - == NULL | + ! - NULL == x ) ) Z Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11Staging: rts5208: Use min instead of ternary operatorBhumika Goyal
This patch replaces ternary operator with macro min as it shorter and thus increases code readability. Macro min returns the minimum of the two compared values. Made a semantic patch for changes: @@ type T; T x; T y; @@ ( - x < y ? x : y + min(x,y) | - x > y ? x : y + max(x,y) ) Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: rts5208: rtsx_transport.c: Drop void pointer castJanani Ravichandran
Void pointers need not be cast to other pointer types. Semantic patch used: @r@ expression x; void *e; type T; identifier f; @@ ( *((T *)e) | ((T *)x) [...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: rts5208: rtsx.c: Drop unneeded void pointer castJanani Ravichandran
Void pointers need not be cast to other pointer types. Semantic patch used: @r@ expression x; void *e; type T; identifier f; @@ ( *((T *)e) | ((T *)x) [...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: rts5208: Remove unnecessary pci_set_drvdata()Amitoj Kaur Chawla
Unnecessary pci_set_drvdata() has been removed since the driver core clears the driver data to NULL after device release or on probe failure. There is no need to manually clear the device driver data to NULL. The Coccinelle semantic patch used to make this change is as follows: //<smpl> @@ struct pci_dev *pci; @@ - pci_set_drvdata(pci, NULL); //</smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11Staging: rts5208: Remove unnecessary parenthesesDilek Uzulmez
Problem found using checkpatch.pl CHECK: Unnecessary parentheses around chip->ms_card Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: rts5208: Prefer using BIT macroBhaktipriya Shridhar
Replace all instances of bit shifting on 1 with the BIT(x) macro. This was done using Coccinelle. @@ int c; @@ - (1 << c) + BIT(c) Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: rts5208: Removed unnecessary return variableBhaktipriya Shridhar
This patch removes unnecessary return variables in switch statements. This was done with Coccinelle: @@ local idexpression ret; expression e1,e2; identifier label; @@ switch ( ... ) { case label : ... - ret = e1; - break; + return e1; ... default: ... - ret = e2; + return e2; ... } ... when != ret - return ret; @@ type T; identifier x; @@ - T x; ... when != x Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: media: davinci_vpfe: 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-11staging: media: davinci_vpfe: dm365_ipipe_hw: Remove unnecessary else after ↵Bhaktipriya Shridhar
return 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-11Staging: media: Remove unnecessary goto.Sandhya Bankar
Remove unnecessary goto. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: [media] mn88472: simplify NULL testsEva Rachel Retuya
Replace direct comparisons to NULL i.e. 'x == NULL' with '!x' for consistency. Coccinelle semantic patch used: @@ identifier func; expression x; statement Z; @@ x = func(...); if ( ( + ! x - == NULL | + ! - NULL == x ) ) Z Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: media: omap4iss: Remove unnecessary platform_set_drvdata()Amitoj Kaur Chawla
Unnecessary platform_set_drvdata() has been removed since the driver core clears the driver data to NULL after device release or on probe failure. There is no need to manually clear the device driver data to NULL. The Coccinelle semantic patch used to make this change is as follows: //<smpl> @@ struct platform_device *pdev; @@ - platform_set_drvdata(pdev, NULL); //</smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11Staging: 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-11staging: 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-11Staging: 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-11staging: 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-11staging: 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-11drivers: 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-11staging: 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-11Staging: 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-11staging: 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-11staging: 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-11staging: 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-11staging: 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-11staging: 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-11staging: ste_rmi4: simplify NULL testsEva Rachel Retuya
Replace direct comparisons to NULL i.e. 'x == NULL' with '!x' for consistency. Coccinelle semantic patch used: @@ identifier func; expression x; statement Z; @@ x = func(...); if ( ( + ! x - == NULL | + ! - NULL == x ) ) Z Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11Staging: ste_rmi4: Add space around '/'Dilek Uzulmez
Add space around operator '/'. Problem found using checkpatch.pl CHECK: spaces preferred around that '/' (ctx:VxV) Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: octeon: Fix braces in condition statementLaura Garcia Liebana
Braces should be used on all arms of the if statement. Checkpatch detected this issue. Signed-off-by: Laura Garcia Liebana <nevola@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: octeon: Remove multiple blank linesLaura Garcia Liebana
Avoid the use of multiple blank lines. Checkpatch detected these issues. Signed-off-by: Laura Garcia Liebana <nevola@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: octeon: Fix lines over 80 charactersLaura Garcia Liebana
The lines should be adjusted to 80 characters. Checkpatch detected these issues. Signed-off-by: Laura Garcia Liebana <nevola@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: octeon: Remove blank lines after open braceLaura Garcia Liebana
Blank lines are not necessary after an open brace. Checkpatch detected these issues. Signed-off-by: Laura Garcia Liebana <nevola@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: octeon: Fix block commentsLaura Garcia Liebana
Remove commented source code. Checkpatch detected these issues. Signed-off-by: Laura Garcia Liebana <nevola@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: octeon: Remove comparison to NULLLaura Garcia Liebana
Comparison to NULL should be avoided in conditions. Chackpatch detected these issues. Signed-off-by: Laura Garcia Liebana <nevola@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: octeon: Insert blank line after struct declarationLaura Garcia Liebana
Blank line is inserted after a struct declaration. Checkpatch detected these issues. Signed-off-by: Laura Garcia Liebana <nevola@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: octeon: Move logical operators on the correct lineLaura Garcia Liebana
Logical continuations should be on the previous line. Checkpatch detected this issue. Signed-off-by: Laura Garcia Liebana <nevola@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: octeon: Convert create_singlethread_workqueue()Bhaktipriya Shridhar
With conccurency managed workqueues, use of dedicated workqueues can be replaced by system_wq. Drop cvm_oct_poll_queue by using system_wq. There are multiple work items per cvm_oct_poll_queue (viz. cvm_oct_rx_refill_work, port_periodic_work) and different cvm_oct_poll_queues need not be be ordered. Hence, concurrency can be increased by switching to system_wq. All work items are sync canceled in cvm_oct_remove() so it is guaranteed that no work is in flight by the time exit path runs. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>