From fe3002c1dc54ec58944448d5f129a6b6513d4246 Mon Sep 17 00:00:00 2001 From: Sergio Paracuellos Date: Thu, 29 Mar 2018 20:07:55 +0200 Subject: [PATCH] staging: ks7010: replace IS_HIF_IND with inline function This commit replaces IS_HIF_IND macro with is_11b_rate inline function to improve readability. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ks7010/ks_hostif.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.h b/drivers/staging/ks7010/ks_hostif.h index 10c8f091a625..09e67f904629 100644 --- a/drivers/staging/ks7010/ks_hostif.h +++ b/drivers/staging/ks7010/ks_hostif.h @@ -610,17 +610,21 @@ enum multicast_filter_type { /* macro function */ #define HIF_EVENT_MASK 0xE800 -#define IS_HIF_IND(_EVENT) ((_EVENT & HIF_EVENT_MASK) == 0xE800 && \ - ((_EVENT & ~HIF_EVENT_MASK) == 0x0001 || \ - (_EVENT & ~HIF_EVENT_MASK) == 0x0006 || \ - (_EVENT & ~HIF_EVENT_MASK) == 0x000C || \ - (_EVENT & ~HIF_EVENT_MASK) == 0x0011 || \ - (_EVENT & ~HIF_EVENT_MASK) == 0x0012)) + +static inline bool is_hif_ind(unsigned short event) +{ + return (((event & HIF_EVENT_MASK) == HIF_EVENT_MASK) && + (((event & ~HIF_EVENT_MASK) == 0x0001) || + ((event & ~HIF_EVENT_MASK) == 0x0006) || + ((event & ~HIF_EVENT_MASK) == 0x000C) || + ((event & ~HIF_EVENT_MASK) == 0x0011) || + ((event & ~HIF_EVENT_MASK) == 0x0012))); +} #define IS_HIF_CONF(_EVENT) ((_EVENT & HIF_EVENT_MASK) == 0xE800 && \ (_EVENT & ~HIF_EVENT_MASK) > 0x0000 && \ (_EVENT & ~HIF_EVENT_MASK) < 0x0012 && \ - !IS_HIF_IND(_EVENT)) + !is_hif_ind(_EVENT)) #ifdef __KERNEL__ -- 2.30.2