From: Sergio Paracuellos Date: Thu, 29 Mar 2018 18:07:54 +0000 (+0200) Subject: staging: ks7010: IS_OFDM_EXT_RATE macro with inline function X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ea5522370ea8e9838dcad800cb9bc7e03392decf;p=openwrt%2Fstaging%2Fblogic.git staging: ks7010: IS_OFDM_EXT_RATE macro with inline function 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index cca2d57fd224..e336d25b5671 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -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 { diff --git a/drivers/staging/ks7010/ks_hostif.h b/drivers/staging/ks7010/ks_hostif.h index 46d8d269790b..10c8f091a625 100644 --- a/drivers/staging/ks7010/ks_hostif.h +++ b/drivers/staging/ks7010/ks_hostif.h @@ -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,