staging: ks7010: replace IS_HIF_IND with inline function
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Thu, 29 Mar 2018 18:07:55 +0000 (20:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2018 12:07:58 +0000 (14:07 +0200)
This commit replaces IS_HIF_IND macro with is_11b_rate inline
function to improve readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.h

index 10c8f091a62518f395ee7db9aeffe2ae168c4a06..09e67f904629d2bc44f284ed79043d13e2f1a176 100644 (file)
@@ -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__