staging: rtl8712: Drop else after return
PATCH 1/1 staging: rtl8712: Drop else after return
Remove unnecessary else when there is a return statement in the corresponding if block.
The following Coccinelle patch used:
@@
expression e2;
statement s1;
@@
if(e2) { ... return ...; }
-else
s1
@@
expression e1;
@@
if (e1) { ... return ...; }
-else{
...-}
Signed-off-by Bhaktipriya Shridhar <[email protected]>
--- drivers/staging/rtl8712/xmit_linux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8712/xmit_linux.c +1 -2
@@ -72,8 +72,7 @@ sint r8712_endofpktfile(struct pkt_file *pfile) {if (pfile->pkt_len ==0 )return true; -else -return false; +return false; }
--
2.1.4
Quoted 31 lines · Bhaktipriya Shridhar
Remove unnecessary else when there is a return statement in the corresponding if block.
The following Coccinelle patch used:
@@
expression e2;
statement s1;
@@
if(e2) { ... return ...; }
-elses1@@
expression e1;
@@
if (e1) { ... return ...; }(quoted diff) +0
-2-else{ -}Signed-off-by Bhaktipriya Shridhar <[email protected]>--- drivers/staging/rtl8712/xmit_linux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/staging/rtl8712/xmit_linux.c +0
-0
drivers/staging/rtl8712/xmit_linux.c sint r8712_endofpktfile(struct pkt_file *pfile) · line 73
Quoted 2 lines
drivers/staging/rtl8712/xmit_linux.c +0
-0@@ -72,8 +72,7 @@ sint r8712_endofpktfile(struct pkt_file *pfile) {if (pfile->pkt_len ==0 )
Here we could just return pfile->pkt_len == 0;