Staging: rtl8188eu: Replace if-else block with switch-case

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>
This commit is contained in:
Vatika Harlalka 2015-02-26 18:14:02 +05:30 committed by Greg Kroah-Hartman
parent 294a7fcc85
commit e790d442b0

View 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); msleep(50);
} else if (addr == 0xfd) { break;
case 0xfd:
mdelay(5); mdelay(5);
} else if (addr == 0xfc) { break;
case 0xfc:
mdelay(1); mdelay(1);
} else if (addr == 0xfb) { break;
case 0xfb:
udelay(50); udelay(50);
} else if (addr == 0xfa) { break;
case 0xfa:
udelay(5); udelay(5);
} else if (addr == 0xf9) { break;
case 0xf9:
udelay(1); udelay(1);
} else{ break;
default:
store_pwrindex_offset(adapt, addr, bit_mask, data); store_pwrindex_offset(adapt, addr, bit_mask, data);
} }
} }