Staging: rtl8188eu: Replace if-else block with switch-case
authorVatika Harlalka <vatikaharlalka@gmail.com>
Thu, 26 Feb 2015 12:44:02 +0000 (18:14 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Feb 2015 20:56:58 +0000 (12:56 -0800)
Replace if-else block with switch-case to make it more compact
and increase readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/bb_cfg.c

index 262da889d3600b85aeda45dc43acb0b1fd9dfbcf..2d3d012d3736a925138a15732b6c696f879d2e02 100644 (file)
@@ -553,21 +553,29 @@ static void store_pwrindex_offset(struct adapter *Adapter, u32 regaddr, u32 bitm
        }
 }
 
-static void rtl_addr_delay(struct adapter *adapt, u32 addr, u32 bit_mask, u32 data)
+static void rtl_addr_delay(struct adapter *adapt,
+                       u32 addr, u32 bit_mask, u32 data)
 {
-       if (addr == 0xfe) {
+       switch (addr) {
+       case 0xfe:
                msleep(50);
-       } else if (addr == 0xfd) {
+               break;
+       case 0xfd:
                mdelay(5);
-       } else if (addr == 0xfc) {
+               break;
+       case 0xfc:
                mdelay(1);
-       } else if (addr == 0xfb) {
+               break;
+       case 0xfb:
                udelay(50);
-       } else if (addr == 0xfa) {
+               break;
+       case 0xfa:
                udelay(5);
-       } else if (addr == 0xf9) {
+               break;
+       case 0xf9:
                udelay(1);
-       } else{
+               break;
+       default:
                store_pwrindex_offset(adapt, addr, bit_mask, data);
        }
 }