From: Sergio Paracuellos Date: Thu, 29 Mar 2018 18:07:55 +0000 (+0200) Subject: staging: ks7010: replace IS_HIF_IND with inline function X-Git-Tag: v4.19~841^2~838 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe3002c1dc54ec58944448d5f129a6b6513d4246;p=platform%2Fkernel%2Flinux-rpi3.git 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 --- diff --git a/drivers/staging/ks7010/ks_hostif.h b/drivers/staging/ks7010/ks_hostif.h index 10c8f09..09e67f9 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__