staging: ks7010: IS_OFDM_EXT_RATE macro with inline function
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Thu, 29 Mar 2018 18:07:54 +0000 (20:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2018 12:07:58 +0000 (14:07 +0200)
This commit replaces IS_OFDM_EXT_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: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.c
drivers/staging/ks7010/ks_hostif.h

index cca2d57fd22408cc6925fb856a2c71805931e28e..e336d25b5671e15e327068e6d763f8f30ec896d3 100644 (file)
@@ -1900,7 +1900,7 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv)
                        if (!is_11bg_rate(priv->reg.rate_set.body[i]))
                                break;
 
-                       if (IS_OFDM_EXT_RATE(priv->reg.rate_set.body[i])) {
+                       if (is_ofdm_ext_rate(priv->reg.rate_set.body[i])) {
                                rate_octet[i] = priv->reg.rate_set.body[i] &
                                                RATE_MASK;
                        } else {
index 46d8d269790b666423d076230d0e96298696b3de..10c8f091a62518f395ee7db9aeffe2ae168c4a06 100644 (file)
@@ -581,9 +581,14 @@ static inline bool is_11bg_rate(u8 rate)
        return (is_11b_rate(rate) || is_ofdm_rate(rate));
 }
 
-#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_54M))
+static inline bool is_ofdm_ext_rate(u8 rate)
+{
+       return (((rate & RATE_MASK) == TX_RATE_9M)  ||
+               ((rate & RATE_MASK) == TX_RATE_18M) ||
+               ((rate & RATE_MASK) == TX_RATE_36M) ||
+               ((rate & RATE_MASK) == TX_RATE_48M) ||
+               ((rate & RATE_MASK) == TX_RATE_54M));
+}
 
 enum connect_status_type {
        CONNECT_STATUS,