staging: xgifb: Compress return logic into one line.
authorElise Lennion <elise.lennion@gmail.com>
Mon, 17 Oct 2016 02:17:20 +0000 (00:17 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Oct 2016 08:27:55 +0000 (10:27 +0200)
Simplify return logic to avoid unnecessary variable assignments.

Coccinelle was used with this semantic patch:
@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/xgifb/vb_setmode.c

index d8010c5c1a700b5cb9b4c656e4fdb4497f92e857..f4bcb15625ce0adb15b166d7ac5d0b1ec67b27f4 100644 (file)
@@ -1682,13 +1682,11 @@ static unsigned char XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex,
                        }
 
                        if (pVBInfo->TVInfo & TVSetYPbPr750p) {
-                               tempal = XGI_YPbPr750pVCLK;
-                               return tempal;
+                               return XGI_YPbPr750pVCLK;
                        }
 
                        if (pVBInfo->TVInfo & TVSetYPbPr525p) {
-                               tempal = YPbPr525pVCLK;
-                               return tempal;
+                               return YPbPr525pVCLK;
                        }
 
                        tempal = NTSC1024VCLK;
@@ -1705,8 +1703,7 @@ static unsigned char XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex,
        } /* {End of VB} */
 
        inb((pVBInfo->P3ca + 0x02));
-       tempal = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-       return tempal;
+       return XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
 }
 
 static void XGI_GetVCLKLen(unsigned char tempal, unsigned char *di_0,