Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> This patch removes unnecessary return variables and compresses the return logic. The coccinelle script that finds and fixes this issue is: @@ type T; identifier i,f; constant C; @@ – T i; …when != i when strict ( return -C; | – i = + return f(…); – return i; ) …
Category: Linux
Feb 25 2016
staging: rdma: hfi1: Remove useless return variables
Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> This patch removes unnecessary return variables and compresses the return logic. The coccinelle script that finds and fixes this issue is: @@ type T; identifier i,f; constant C; @@ – T i; …when != i when strict ( return -C; | – i = + return f(…); – return i; ) …
Feb 25 2016
staging: rtl8712: Make return of 0 explicit
Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> 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; ) … …
Feb 25 2016
staging: rts5208: Remove unnecessary pci_set_drvdata()
Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> 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: // @@ struct …
Feb 25 2016
staging: rdma: hfi1: Remove unnecessary pci_set_drvdata()
Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> 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: // @@ struct …
Feb 25 2016
staging: unisys: visorbus: Remove unnecessary dev_set_drvdata()
Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Unnecessary dev_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: // @@ struct …
Feb 25 2016
staging: media: omap4iss: Remove unnecessary platform_set_drvdata()
Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> 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: // @@ struct …
Feb 25 2016
staging: sm750fb: Remove unnecessary pci_set_drvdata()
Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> 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: // @@ struct …
Feb 25 2016
staging: fbtft: Remove unnecessary spi_set_drvdata()
Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Unnecessary spi_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: @@ struct spi_device …
Feb 25 2016
staging: android: Replace min_t/max_t with min/max
Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Replace min_t/max_t with min/max when both variables are of the same type. The Coccinelle semantic patch used to make this change is as follows: @@ type T; T a,b; @@ – min_t(T, a, b) + min(a, b) @@ type T; T a,b; @@ – max_t(T, a, b) + max(a, b) …