diff options
author | George Edward Bulmer <gebulmer@googlemail.com> | 2017-12-29 16:26:20 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-08 10:36:00 -0500 |
commit | 6724ed7f28d6e83956a7219a9a02a4d620ef65d8 (patch) | |
tree | dd9141ff6f7a4d02720b5933ef1dedb6bd3a9836 | |
parent | 9917b209f8e641b8649c638fba2fc2b8aacb150f (diff) |
staging: most: convert macro to static function
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>
-rw-r--r-- | drivers/staging/most/net/net.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c index 33606584e50e..30d816b7e165 100644 --- a/drivers/staging/most/net/net.c +++ b/drivers/staging/most/net/net.c | |||
@@ -46,10 +46,12 @@ | |||
46 | ((len) > MEP_HDR_LEN && \ | 46 | ((len) > MEP_HDR_LEN && \ |
47 | EXTRACT_BIT_SET(PMS_FIFONO, (buf)[3]) == PMS_FIFONO_MEP) | 47 | EXTRACT_BIT_SET(PMS_FIFONO, (buf)[3]) == PMS_FIFONO_MEP) |
48 | 48 | ||
49 | #define PMS_IS_MAMAC(buf, len) \ | 49 | static inline bool pms_is_mamac(char *buf, u32 len) |
50 | ((len) > MDP_HDR_LEN && \ | 50 | { |
51 | EXTRACT_BIT_SET(PMS_FIFONO, (buf)[3]) == PMS_FIFONO_MDP && \ | 51 | return (len > MDP_HDR_LEN && |
52 | EXTRACT_BIT_SET(PMS_TELID, (buf)[14]) == PMS_TELID_UNSEGM_MAMAC) | 52 | EXTRACT_BIT_SET(PMS_FIFONO, buf[3]) == PMS_FIFONO_MDP && |
53 | EXTRACT_BIT_SET(PMS_TELID, buf[14]) == PMS_TELID_UNSEGM_MAMAC); | ||
54 | } | ||
53 | 55 | ||
54 | struct net_dev_channel { | 56 | struct net_dev_channel { |
55 | bool linked; | 57 | bool linked; |
@@ -435,7 +437,7 @@ static int comp_rx_data(struct mbo *mbo) | |||
435 | dev = nd->dev; | 437 | dev = nd->dev; |
436 | 438 | ||
437 | if (nd->is_mamac) { | 439 | if (nd->is_mamac) { |
438 | if (!PMS_IS_MAMAC(buf, len)) { | 440 | if (!pms_is_mamac(buf, len)) { |
439 | ret = -EIO; | 441 | ret = -EIO; |
440 | goto put_nd; | 442 | goto put_nd; |
441 | } | 443 | } |