Commit fe3002c1 authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman
Browse files

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: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ea552237
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -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__