staging: vt6655: Merge three statements into one
PATCH 1/1 staging: vt6655: Merge three statements into one
This patch merges three lines into one, removing if branch.
A simplified version of the Coccinelle semantic patch used to find this is as follows:
//<smpl>
@@
expression e;
@@
- if(e)
- return false;
- return true;
+ return !e;
//</smpl>
--- drivers/staging/vt6655/rf.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/vt6655/rf.c +1 -4
@@ -518,10 +518,7 @@ bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned long dwData)break ; } -if (ww ==W_MAX_TIMEOUT ) -return false; - -return true; +return !(ww ==W_MAX_TIMEOUT ); }/*
Signature · 1 line
1.9.1
Greg KH
maintainerQuoted 25 lines · Amitoj Kaur Chawla
This patch merges three lines into one, removing if branch.
A simplified version of the Coccinelle semantic patch used to find this is as follows:
//<smpl>
@@
expression e;
@@
- if(e)
- return false;
- return true;
+ return !e;
//</smpl>Signed-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/vt6655/rf.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/staging/vt6655/rf.c +0
-0
drivers/staging/vt6655/rf.c bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned long dwData) · line 521
Quoted 8 lines
drivers/staging/vt6655/rf.c +1
-4@@ -518,10 +518,7 @@ bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned long dwData)break ; } -if (ww ==W_MAX_TIMEOUT ) -return false; - -return true; +return !(ww ==W_MAX_TIMEOUT );
That's crazy, that's much less readable than before.
Remember, kernel code is ment for people to read it and instantly know what is going on, don't force us to think :)
thanks,
greg k-h