staging: ft1000: ft1000-usb: Removed unnecessary else statement.
authorGulsah Kose <gulsah.1004@gmail.com>
Tue, 30 Sep 2014 17:32:07 +0000 (20:32 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Oct 2014 17:13:37 +0000 (10:13 -0700)
This patch fixes "else is not generally useful after a break or return"
checkpatch.pl warning in ft1000_hw.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c

index 36a3ffeb2d648bfdeeb67a4aafb4d48536effa7d..2e13e7b7ec10d9f6c94d2fbfa52687be091cc01f 100644 (file)
@@ -566,10 +566,9 @@ static int ft1000_copy_down_pkt(struct net_device *netdev, u8 *packet, u16 len)
        if (ret) {
                DEBUG("ft1000 failed tx_urb %d\n", ret);
                return ret;
-       } else {
-               pInfo->stats.tx_packets++;
-               pInfo->stats.tx_bytes += (len + 14);
        }
+       pInfo->stats.tx_packets++;
+       pInfo->stats.tx_bytes += (len + 14);
 
        return 0;
 }
@@ -998,53 +997,52 @@ static bool ft1000_receive_cmd(struct ft1000_usb *dev, u16 *pbuffer,
                DEBUG("FT1000:ft1000_receive_cmd:Invalid command length = %d\n",
                      size);
                return FALSE;
-       } else {
-               ppseudohdr = (u16 *) pbuffer;
-               ft1000_write_register(dev, FT1000_DPRAM_MAG_RX_BASE,
-                                     FT1000_REG_DPRAM_ADDR);
-               ret =
-                   ft1000_read_register(dev, pbuffer, FT1000_REG_MAG_DPDATAH);
-               pbuffer++;
-               ft1000_write_register(dev, FT1000_DPRAM_MAG_RX_BASE + 1,
-                                     FT1000_REG_DPRAM_ADDR);
-               for (i = 0; i <= (size >> 2); i++) {
-                       ret =
-                           ft1000_read_register(dev, pbuffer,
-                                                FT1000_REG_MAG_DPDATAL);
-                       pbuffer++;
-                       ret =
-                           ft1000_read_register(dev, pbuffer,
-                                                FT1000_REG_MAG_DPDATAH);
-                       pbuffer++;
-               }
-               /* copy odd aligned word */
+       }
+       ppseudohdr = (u16 *) pbuffer;
+       ft1000_write_register(dev, FT1000_DPRAM_MAG_RX_BASE,
+                             FT1000_REG_DPRAM_ADDR);
+       ret =
+           ft1000_read_register(dev, pbuffer, FT1000_REG_MAG_DPDATAH);
+       pbuffer++;
+       ft1000_write_register(dev, FT1000_DPRAM_MAG_RX_BASE + 1,
+                             FT1000_REG_DPRAM_ADDR);
+       for (i = 0; i <= (size >> 2); i++) {
                ret =
-                   ft1000_read_register(dev, pbuffer, FT1000_REG_MAG_DPDATAL);
-
+                   ft1000_read_register(dev, pbuffer,
+                                        FT1000_REG_MAG_DPDATAL);
                pbuffer++;
                ret =
-                   ft1000_read_register(dev, pbuffer, FT1000_REG_MAG_DPDATAH);
-
+                   ft1000_read_register(dev, pbuffer,
+                                        FT1000_REG_MAG_DPDATAH);
                pbuffer++;
-               if (size & 0x0001) {
-                       /* copy odd byte from fifo */
-                       ret =
-                           ft1000_read_register(dev, &tempword,
-                                                FT1000_REG_DPRAM_DATA);
-                       *pbuffer = ntohs(tempword);
-               }
-               /* Check if pseudo header checksum is good
-                * Calculate pseudo header checksum
-                */
-               tempword = *ppseudohdr++;
-               for (i = 1; i < 7; i++)
-                       tempword ^= *ppseudohdr++;
+       }
+       /* copy odd aligned word */
+       ret =
+           ft1000_read_register(dev, pbuffer, FT1000_REG_MAG_DPDATAL);
 
-               if (tempword != *ppseudohdr)
-                       return FALSE;
+       pbuffer++;
+       ret =
+           ft1000_read_register(dev, pbuffer, FT1000_REG_MAG_DPDATAH);
 
-               return TRUE;
+       pbuffer++;
+       if (size & 0x0001) {
+               /* copy odd byte from fifo */
+               ret =
+                   ft1000_read_register(dev, &tempword,
+                                        FT1000_REG_DPRAM_DATA);
+               *pbuffer = ntohs(tempword);
        }
+       /* Check if pseudo header checksum is good
+        * Calculate pseudo header checksum
+        */
+       tempword = *ppseudohdr++;
+       for (i = 1; i < 7; i++)
+               tempword ^= *ppseudohdr++;
+
+       if (tempword != *ppseudohdr)
+               return FALSE;
+
+       return TRUE;
 }
 
 static int ft1000_dsp_prov(void *arg)