staging: most: convert macro to static function
authorGeorge Edward Bulmer <gebulmer@googlemail.com>
Fri, 29 Dec 2017 21:26:20 +0000 (21:26 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jan 2018 15:36:00 +0000 (16:36 +0100)
This fixes checkpatch warning:
CHECK: Macro argument reuse 'buf' - possible side effects?

Signed-off-by: George Edward Bulmer <gebulmer@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/net/net.c

index 33606584e50e397a44ec24509d9e229a9be2d990..30d816b7e16567f843d67d4ed0c41e1becbd39af 100644 (file)
        ((len) > MEP_HDR_LEN && \
         EXTRACT_BIT_SET(PMS_FIFONO, (buf)[3]) == PMS_FIFONO_MEP)
 
-#define PMS_IS_MAMAC(buf, len) \
-       ((len) > MDP_HDR_LEN && \
-        EXTRACT_BIT_SET(PMS_FIFONO, (buf)[3]) == PMS_FIFONO_MDP && \
-        EXTRACT_BIT_SET(PMS_TELID, (buf)[14]) == PMS_TELID_UNSEGM_MAMAC)
+static inline bool pms_is_mamac(char *buf, u32 len)
+{
+       return (len > MDP_HDR_LEN &&
+               EXTRACT_BIT_SET(PMS_FIFONO, buf[3]) == PMS_FIFONO_MDP &&
+               EXTRACT_BIT_SET(PMS_TELID, buf[14]) == PMS_TELID_UNSEGM_MAMAC);
+}
 
 struct net_dev_channel {
        bool linked;
@@ -435,7 +437,7 @@ static int comp_rx_data(struct mbo *mbo)
        dev = nd->dev;
 
        if (nd->is_mamac) {
-               if (!PMS_IS_MAMAC(buf, len)) {
+               if (!pms_is_mamac(buf, len)) {
                        ret = -EIO;
                        goto put_nd;
                }