Commit b67cd79f authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

staging: ks7010: replace IS_11B_RATE macro with inline function

This commit replaces IS_11B_RATE macro with is_11b_rate inline
function to improve readability.

It also fix a checkpatch script warning because a line with more
than 80 spaces.
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 593c9c7c
...@@ -1884,7 +1884,7 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv) ...@@ -1884,7 +1884,7 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv)
/* rate mask by phy setting */ /* rate mask by phy setting */
if (priv->reg.phy_type == D_11B_ONLY_MODE) { if (priv->reg.phy_type == D_11B_ONLY_MODE) {
for (i = 0; i < priv->reg.rate_set.size; i++) { for (i = 0; i < priv->reg.rate_set.size; i++) {
if (!IS_11B_RATE(priv->reg.rate_set.body[i])) if (!is_11b_rate(priv->reg.rate_set.body[i]))
break; break;
if ((priv->reg.rate_set.body[i] & RATE_MASK) >= TX_RATE_5M) { if ((priv->reg.rate_set.body[i] & RATE_MASK) >= TX_RATE_5M) {
......
...@@ -556,15 +556,20 @@ struct hostif_mic_failure_confirm_t { ...@@ -556,15 +556,20 @@ struct hostif_mic_failure_confirm_t {
#define TX_RATE_48M (uint8_t)(480 / 5) #define TX_RATE_48M (uint8_t)(480 / 5)
#define TX_RATE_54M (uint8_t)(540 / 5) #define TX_RATE_54M (uint8_t)(540 / 5)
#define IS_11B_RATE(A) (((A & RATE_MASK) == TX_RATE_1M) || ((A & RATE_MASK) == TX_RATE_2M) || \ static inline bool is_11b_rate(u8 rate)
((A & RATE_MASK) == TX_RATE_5M) || ((A & RATE_MASK) == TX_RATE_11M)) {
return (((rate & RATE_MASK) == TX_RATE_1M) ||
((rate & RATE_MASK) == TX_RATE_2M) ||
((rate & RATE_MASK) == TX_RATE_5M) ||
((rate & RATE_MASK) == TX_RATE_11M));
}
#define IS_OFDM_RATE(A) (((A & RATE_MASK) == TX_RATE_6M) || ((A & RATE_MASK) == TX_RATE_12M) || \ #define IS_OFDM_RATE(A) (((A & RATE_MASK) == TX_RATE_6M) || ((A & RATE_MASK) == TX_RATE_12M) || \
((A & RATE_MASK) == TX_RATE_24M) || ((A & RATE_MASK) == TX_RATE_9M) || \ ((A & RATE_MASK) == TX_RATE_24M) || ((A & RATE_MASK) == TX_RATE_9M) || \
((A & RATE_MASK) == TX_RATE_18M) || ((A & RATE_MASK) == TX_RATE_36M) || \ ((A & RATE_MASK) == TX_RATE_18M) || ((A & RATE_MASK) == TX_RATE_36M) || \
((A & RATE_MASK) == TX_RATE_48M) || ((A & RATE_MASK) == TX_RATE_54M)) ((A & RATE_MASK) == TX_RATE_48M) || ((A & RATE_MASK) == TX_RATE_54M))
#define IS_11BG_RATE(A) (IS_11B_RATE(A) || IS_OFDM_RATE(A)) #define IS_11BG_RATE(A) (is_11b_rate(A) || IS_OFDM_RATE(A))
#define IS_OFDM_EXT_RATE(A) (((A & RATE_MASK) == TX_RATE_9M) || ((A & RATE_MASK) == TX_RATE_18M) || \ #define IS_OFDM_EXT_RATE(A) (((A & RATE_MASK) == TX_RATE_9M) || ((A & RATE_MASK) == TX_RATE_18M) || \
((A & RATE_MASK) == TX_RATE_36M) || ((A & RATE_MASK) == TX_RATE_48M) || \ ((A & RATE_MASK) == TX_RATE_36M) || ((A & RATE_MASK) == TX_RATE_48M) || \
......
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