summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8188eu
diff options
context:
space:
mode:
authorVatika Harlalka <vatikaharlalka@gmail.com>2015-02-23 14:02:38 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-26 20:45:32 (GMT)
commit93ab486d3f2f87118c5a268a9ceeaf8721bfcb1b (patch)
treeb86840f93fa6001689db18a7c4acd9934eb1de5d /drivers/staging/rtl8188eu
parentefb8d497941fc2f97d87da65dfa93b7df620143a (diff)
downloadlinux-93ab486d3f2f87118c5a268a9ceeaf8721bfcb1b.tar.xz
Staging: rtl8188eu: Changed array and loop construct
This function only required the array from the 14th element onwards. Therefore, the array size is reduced and the loop counter is modified so as to start from 0. Also, the assignment of variable place is redundant as it is initialized again in the loop. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu')
-rw-r--r--drivers/staging/rtl8188eu/hal/phy.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 623fb4f..6448fca 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -371,19 +371,18 @@ void phy_sw_chnl(struct adapter *adapt, u8 channel)
static u8 get_right_chnl_for_iqk(u8 chnl)
{
+ u8 place;
u8 channel_all[ODM_TARGET_CHNL_NUM_2G_5G] = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64,
100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122,
124, 126, 128, 130, 132, 134, 136, 138, 140, 149, 151, 153,
155, 157, 159, 161, 163, 165
};
- u8 place = chnl;
if (chnl > 14) {
- for (place = 14; place < sizeof(channel_all); place++) {
+ for (place = 0; place < sizeof(channel_all); place++) {
if (channel_all[place] == chnl)
- return place-13;
+ return ++place;
}
}
return 0;