]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
utils: Move BIT macro to common header
authorLeon Romanovsky <leonro@mellanox.com>
Sun, 20 Aug 2017 09:58:21 +0000 (12:58 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 22 Aug 2017 00:07:44 +0000 (17:07 -0700)
BIT() macro was implemented and used by devlink for now, but following
patches of rdmatool will reuse the same macro, so put it in common
header file.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
devlink/devlink.c
include/utils.h

index f9bc16c350c40975c2131bc2a0b9c0958535cd25..7602970bc58a8e0a25da1517bedd4b9ed695703b 100644 (file)
@@ -25,6 +25,7 @@
 #include "list.h"
 #include "mnlg.h"
 #include "json_writer.h"
+#include "utils.h"
 
 #define ESWITCH_MODE_LEGACY "legacy"
 #define ESWITCH_MODE_SWITCHDEV "switchdev"
@@ -160,7 +161,6 @@ static void ifname_map_free(struct ifname_map *ifname_map)
        free(ifname_map);
 }
 
-#define BIT(nr)                 (1UL << (nr))
 #define DL_OPT_HANDLE          BIT(0)
 #define DL_OPT_HANDLEP         BIT(1)
 #define DL_OPT_PORT_TYPE       BIT(2)
index 6080b962fb41114ababb505104978a980a11ae65..7a3b3fd24058f8546ac76f611be0599d38677edd 100644 (file)
@@ -195,6 +195,8 @@ static inline void __jiffies_to_tv(struct timeval *tv, unsigned long jiffies)
 int print_timestamp(FILE *fp);
 void print_nlmsg_timestamp(FILE *fp, const struct nlmsghdr *n);
 
+#define BIT(nr)                 (1UL << (nr))
+
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
 #define BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)]))