From 8710f5b17436ac9cd8208fc4b004052b13e7da05 Mon Sep 17 00:00:00 2001 From: Sergio Paracuellos Date: Thu, 29 Mar 2018 20:07:53 +0200 Subject: [PATCH] staging: ks7010: replace IS_11BG_RATE macro with inline function This commit replaces IS_11BG_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 --- drivers/staging/ks7010/ks_hostif.c | 2 +- drivers/staging/ks7010/ks_hostif.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 9f6d49e04d87..cca2d57fd224 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1897,7 +1897,7 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv) } else { /* D_11G_ONLY_MODE or D_11BG_COMPATIBLE_MODE */ for (i = 0; i < priv->reg.rate_set.size; i++) { - if (!IS_11BG_RATE(priv->reg.rate_set.body[i])) + if (!is_11bg_rate(priv->reg.rate_set.body[i])) break; if (IS_OFDM_EXT_RATE(priv->reg.rate_set.body[i])) { diff --git a/drivers/staging/ks7010/ks_hostif.h b/drivers/staging/ks7010/ks_hostif.h index 04bff238edc9..46d8d269790b 100644 --- a/drivers/staging/ks7010/ks_hostif.h +++ b/drivers/staging/ks7010/ks_hostif.h @@ -576,7 +576,10 @@ static inline bool is_ofdm_rate(u8 rate) ((rate & RATE_MASK) == TX_RATE_54M)); } -#define IS_11BG_RATE(A) (is_11b_rate(A) || is_ofdm_rate(A)) +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) || \ -- 2.30.2