]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: ks7010: replace IS_HIF_CONF with inline function
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Thu, 29 Mar 2018 18:07:56 +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_CONF 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/ks7010_sdio.c
drivers/staging/ks7010/ks_hostif.h

index b8f55a11ee1c66c13f71f8468aab62bed99758e5..0cc14ac9e8e159e3684c46166b0cb99262e9ae96 100644 (file)
@@ -408,7 +408,7 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size)
                netdev_err(priv->net_dev, " error : READ_STATUS\n");
 
        if (atomic_read(&priv->psstatus.confirm_wait)) {
-               if (IS_HIF_CONF(event)) {
+               if (is_hif_conf(event)) {
                        netdev_dbg(priv->net_dev, "IS_HIF_CONF true !!\n");
                        atomic_dec(&priv->psstatus.confirm_wait);
                }
index 09e67f904629d2bc44f284ed79043d13e2f1a176..f4f9c1ee11d168a527e9af78669fe81ecda8e5a6 100644 (file)
@@ -608,7 +608,6 @@ enum multicast_filter_type {
 
 #define NIC_MAX_MCAST_LIST 32
 
-/* macro function */
 #define HIF_EVENT_MASK 0xE800
 
 static inline bool is_hif_ind(unsigned short event)
@@ -621,10 +620,13 @@ static inline bool is_hif_ind(unsigned short event)
                 ((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))
+static inline bool is_hif_conf(unsigned short event)
+{
+       return (((event & HIF_EVENT_MASK) == HIF_EVENT_MASK) &&
+               ((event & ~HIF_EVENT_MASK) > 0x0000) &&
+               ((event & ~HIF_EVENT_MASK) < 0x0012) &&
+               !is_hif_ind(event));
+}
 
 #ifdef __KERNEL__