Skip to contentSkip to conversation

Staging: xgifb: Compress return logic

PATCH New Bhumika Goyal 1 participant 1 message Sep 18, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: xgifb: Compress return logic

This patch compresses the return logic into a single statement and removes the now unused return variable.
Done using coccinelle:
@@
type T;
identifier r;
@@
- T r;
... when !=r
- r =
+ return

     ...;

- return r;

---
 drivers/staging/xgifb/XGI_main_26.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/xgifb/XGI_main_26.c +1 -4
index d56ef14..cc69233 100644
@@ -62,7 +62,6 @@ static int XGIfb_mode_rate_to_dclock(struct vb_device_info *XGI_Pr,
 	unsigned short ModeNo = modeno;
 	unsigned short ModeIdIndex = 0, ClockIndex = 0;
 	unsigned short RefreshRateTableIndex = 0;
-	int Clock;
 
 	InitTo330Pointer(HwDeviceExtension->jChipType, XGI_Pr);
 
@@ -73,9 +72,7 @@ static int XGIfb_mode_rate_to_dclock(struct vb_device_info *XGI_Pr,
 
 	ClockIndex = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
 
-	Clock = XGI_VCLKData[ClockIndex].CLOCK * 1000;
-
-	return Clock;
+	return XGI_VCLKData[ClockIndex].CLOCK * 1000;
 }
 
 static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
Signature · 1 line
1.9.1