staging: xgifb: remove unnecessary else
authorThomas Gummerer <t.gummerer@gmail.com>
Fri, 5 Sep 2014 15:09:34 +0000 (17:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Sep 2014 04:48:19 +0000 (21:48 -0700)
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/xgifb/XGI_main_26.c
drivers/staging/xgifb/vb_init.c
drivers/staging/xgifb/vb_setmode.c

index f82f0574bbdca7988f176da3709af3d8d058c0a0..be7778b5911877e470c2d4b72e9fc898613586f1 100644 (file)
@@ -588,13 +588,11 @@ static u8 XGIfb_search_refresh_rate(struct xgifb_video_info *xgifb_info,
                }
                i++;
        }
-       if (xgifb_info->rate_idx > 0) {
+       if (xgifb_info->rate_idx > 0)
                return xgifb_info->rate_idx;
-       } else {
-               pr_info("Unsupported rate %d for %dx%d\n",
-                      rate, xres, yres);
-               return 0;
-       }
+       pr_info("Unsupported rate %d for %dx%d\n",
+               rate, xres, yres);
+       return 0;
 }
 
 static void XGIfb_search_tvstd(const char *name)
index ff210ddcbf9e5c1936a0f2fb931a0ad69e4607a2..2b233af8eb80dcb3813c2e12bd9a02a7ec8e6fc7 100644 (file)
@@ -63,14 +63,13 @@ XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension,
                /* ~HOTPLUG_SUPPORT */
                xgifb_reg_or(pVBInfo->P3d4, 0xB4, 0x02);
                return data;
-       } else {
-               data = xgifb_reg_get(pVBInfo->P3d4, 0x97) & 0x01;
+       }
+       data = xgifb_reg_get(pVBInfo->P3d4, 0x97) & 0x01;
 
-               if (data == 1)
-                       data++;
+       if (data == 1)
+               data++;
 
-               return data;
-       }
+       return data;
 }
 
 static void XGINew_DDR1x_MRS_340(unsigned long P3c4,
@@ -578,9 +577,8 @@ static unsigned char XGINew_CheckFrequence(struct vb_device_info *pVBInfo)
                data = xgifb_reg_get(pVBInfo->P3c4, 0x39);
                data = (data & 0x02) >> 1;
                return data;
-       } else {
-               return data & 0x01;
        }
+       return data & 0x01;
 }
 
 static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
@@ -637,10 +635,9 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
 
                                if (XGINew_ReadWriteRest(23, 22, pVBInfo) == 1)
                                        return;
-                               else
-                                       xgifb_reg_set(pVBInfo->P3c4,
-                                                     0x13,
-                                                     0x31);
+                               xgifb_reg_set(pVBInfo->P3c4,
+                                             0x13,
+                                             0x31);
                                udelay(15);
                        }
 
@@ -687,10 +684,11 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
 
                                if (XGINew_ReadWriteRest(22, 21, pVBInfo) == 1)
                                        return;
-                               else /* (0x31:12x8x2) 22bit + 1 rank */
-                                       xgifb_reg_set(pVBInfo->P3c4,
-                                                     0x13,
-                                                     0x31);
+
+                               /* (0x31:12x8x2) 22bit + 1 rank */
+                               xgifb_reg_set(pVBInfo->P3c4,
+                                             0x13,
+                                             0x31);
                                udelay(15);
                        }
                }
@@ -729,10 +727,8 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
 
                        if (XGINew_ReadWriteRest(23, 22, pVBInfo) == 1)
                                return;
-                       else {
-                               xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
-                               xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x30);
-                       }
+                       xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
+                       xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x30);
                } else { /* DDR */
                        pVBInfo->ram_bus = 64; /* 64 bits */
                        pVBInfo->ram_channel = 1; /* 1 channels */
@@ -741,10 +737,8 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
 
                        if (XGINew_ReadWriteRest(24, 23, pVBInfo) == 1)
                                return;
-                       else {
-                               xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
-                               xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x42);
-                       }
+                       xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
+                       xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x42);
                }
 
                break;
@@ -781,12 +775,10 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
                        xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xA1);
                        xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x5A);
 
-                       if (XGINew_ReadWriteRest(25, 24, pVBInfo) == 1) {
+                       if (XGINew_ReadWriteRest(25, 24, pVBInfo) == 1)
                                return;
-                       } else {
-                               xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
-                               xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x4A);
-                       }
+                       xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
+                       xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x4A);
                }
                break;
        }
index 8795e173cb5aef1f6322a3279e370a745ee1ebc8..d5f49d2a8db3185bde614adab07122bcd03f99c4 100644 (file)
@@ -3895,8 +3895,7 @@ static struct XGI301C_Tap4TimingStruct const
 
        if (tempax <= tempbx)
                return &xgifb_tap4_timing[0];
-       else
-               Tap4TimingPtr = xgifb_ntsc_525_tap4_timing; /* NTSC */
+       Tap4TimingPtr = xgifb_ntsc_525_tap4_timing; /* NTSC */
 
        if (pVBInfo->TVInfo & TVSetPAL)
                Tap4TimingPtr = PALTap4Timing;