Commit f0de833a authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman

staging: rtl8723bs: simplify ratetbl_val_2wifirate()

Simplify ratetbl_val_2wifirate() by not using extra variable
for the return value.
Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c9d19e68
...@@ -140,59 +140,34 @@ u8 networktype_to_raid_ex(struct adapter *adapter, struct sta_info *psta) ...@@ -140,59 +140,34 @@ u8 networktype_to_raid_ex(struct adapter *adapter, struct sta_info *psta)
unsigned char ratetbl_val_2wifirate(unsigned char rate); unsigned char ratetbl_val_2wifirate(unsigned char rate);
unsigned char ratetbl_val_2wifirate(unsigned char rate) unsigned char ratetbl_val_2wifirate(unsigned char rate)
{ {
unsigned char val = 0;
switch (rate & 0x7f) { switch (rate & 0x7f) {
case 0: case 0:
val = IEEE80211_CCK_RATE_1MB; return IEEE80211_CCK_RATE_1MB;
break;
case 1: case 1:
val = IEEE80211_CCK_RATE_2MB; return IEEE80211_CCK_RATE_2MB;
break;
case 2: case 2:
val = IEEE80211_CCK_RATE_5MB; return IEEE80211_CCK_RATE_5MB;
break;
case 3: case 3:
val = IEEE80211_CCK_RATE_11MB; return IEEE80211_CCK_RATE_11MB;
break;
case 4: case 4:
val = IEEE80211_OFDM_RATE_6MB; return IEEE80211_OFDM_RATE_6MB;
break;
case 5: case 5:
val = IEEE80211_OFDM_RATE_9MB; return IEEE80211_OFDM_RATE_9MB;
break;
case 6: case 6:
val = IEEE80211_OFDM_RATE_12MB; return IEEE80211_OFDM_RATE_12MB;
break;
case 7: case 7:
val = IEEE80211_OFDM_RATE_18MB; return IEEE80211_OFDM_RATE_18MB;
break;
case 8: case 8:
val = IEEE80211_OFDM_RATE_24MB; return IEEE80211_OFDM_RATE_24MB;
break;
case 9: case 9:
val = IEEE80211_OFDM_RATE_36MB; return IEEE80211_OFDM_RATE_36MB;
break;
case 10: case 10:
val = IEEE80211_OFDM_RATE_48MB; return IEEE80211_OFDM_RATE_48MB;
break;
case 11: case 11:
val = IEEE80211_OFDM_RATE_54MB; return IEEE80211_OFDM_RATE_54MB;
break; default:
return 0;
} }
return val;
} }
int is_basicrate(struct adapter *padapter, unsigned char rate); int is_basicrate(struct adapter *padapter, unsigned char rate);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment