staging: xgifb: compress return logic
PATCH 1/1 staging: xgifb: compress return logic
compress return logic into a single statement, using semantic patch:
@@
local idexpression ret;
expression e;
@@
-ret =
+return
e;
-return ret;
Signed-off-by Gargi Sharma <[email protected]>
--- drivers/staging/xgifb/vb_init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/xgifb/vb_init.c +1 -2
@@ -576,8 +576,7 @@ static unsigned char XGINew_CheckFrequence(struct vb_device_info *pVBInfo)if ((data &0x10 ) ==0 ) { data =xgifb_reg_get (pVBInfo->P3c4,0x39 ); - data = (data &0x02 ) >>1 ; -return data; +return (data &0x02 ) >>1 ; }return data &0x01 ; }
Signature · 1 line
2.9.2
Greg KH
maintainerQuoted 22 lines · Gargi Sharma
compress return logic into a single statement, using semantic patch:
@@
local idexpression ret;
expression e;
@@(quoted diff) +1
-2-ret = +return e; -return ret;Signed-off-by Gargi Sharma <[email protected]>--- drivers/staging/xgifb/vb_init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/staging/xgifb/vb_init.c +0
-0
drivers/staging/xgifb/vb_init.c static unsigned char XGINew_CheckFrequence(struct vb_device_info *pVBInfo) · line 579
Quoted 6 lines
drivers/staging/xgifb/vb_init.c +1
-2@@ -576,8 +576,7 @@ static unsigned char XGINew_CheckFrequence(struct vb_device_info *pVBInfo)if ((data &0x10 ) ==0 ) { data =xgifb_reg_get (pVBInfo->P3c4,0x39 ); - data = (data &0x02 ) >>1 ; -return data; +return (data &0x02 ) >>1 ;
I'm going to argue that the original code is easier to read and understand. The output of the compiler will be the same, so can we leave this as-is?
thanks,
gre k-h