|
|
36cfb7 |
From 42a457a97118379936cdeb20eef1d116e858d4c1 Mon Sep 17 00:00:00 2001
|
|
|
36cfb7 |
From: Andrea Claudi <aclaudi@redhat.com>
|
|
|
36cfb7 |
Date: Mon, 25 Mar 2019 13:30:09 +0100
|
|
|
36cfb7 |
Subject: [PATCH] utils: Move BIT macro to common header
|
|
|
36cfb7 |
|
|
|
36cfb7 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1642479
|
|
|
36cfb7 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1641914
|
|
|
36cfb7 |
Upstream Status: iproute2.git commit afdc119410efe
|
|
|
36cfb7 |
|
|
|
36cfb7 |
commit afdc119410efe2a5e826c660446b1e4e1a72793d
|
|
|
36cfb7 |
Author: Leon Romanovsky <leonro@mellanox.com>
|
|
|
36cfb7 |
Date: Sun Aug 20 12:58:21 2017 +0300
|
|
|
36cfb7 |
|
|
|
36cfb7 |
utils: Move BIT macro to common header
|
|
|
36cfb7 |
|
|
|
36cfb7 |
BIT() macro was implemented and used by devlink for now, but following
|
|
|
36cfb7 |
patches of rdmatool will reuse the same macro, so put it in common
|
|
|
36cfb7 |
header file.
|
|
|
36cfb7 |
|
|
|
36cfb7 |
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
|
|
|
36cfb7 |
---
|
|
|
36cfb7 |
devlink/devlink.c | 2 +-
|
|
|
36cfb7 |
include/utils.h | 2 ++
|
|
|
36cfb7 |
2 files changed, 3 insertions(+), 1 deletion(-)
|
|
|
36cfb7 |
|
|
|
36cfb7 |
diff --git a/devlink/devlink.c b/devlink/devlink.c
|
|
|
36cfb7 |
index 92e78c9c8d9f6..2000db81aabb0 100644
|
|
|
36cfb7 |
--- a/devlink/devlink.c
|
|
|
36cfb7 |
+++ b/devlink/devlink.c
|
|
|
36cfb7 |
@@ -25,6 +25,7 @@
|
|
|
36cfb7 |
#include "list.h"
|
|
|
36cfb7 |
#include "mnlg.h"
|
|
|
36cfb7 |
#include "json_writer.h"
|
|
|
36cfb7 |
+#include "utils.h"
|
|
|
36cfb7 |
|
|
|
36cfb7 |
#define ESWITCH_MODE_LEGACY "legacy"
|
|
|
36cfb7 |
#define ESWITCH_MODE_SWITCHDEV "switchdev"
|
|
|
36cfb7 |
@@ -164,7 +165,6 @@ static void ifname_map_free(struct ifname_map *ifname_map)
|
|
|
36cfb7 |
free(ifname_map);
|
|
|
36cfb7 |
}
|
|
|
36cfb7 |
|
|
|
36cfb7 |
-#define BIT(nr) (1UL << (nr))
|
|
|
36cfb7 |
#define DL_OPT_HANDLE BIT(0)
|
|
|
36cfb7 |
#define DL_OPT_HANDLEP BIT(1)
|
|
|
36cfb7 |
#define DL_OPT_PORT_TYPE BIT(2)
|
|
|
36cfb7 |
diff --git a/include/utils.h b/include/utils.h
|
|
|
36cfb7 |
index 8c12e1e2a60c2..d707a9dacdb85 100644
|
|
|
36cfb7 |
--- a/include/utils.h
|
|
|
36cfb7 |
+++ b/include/utils.h
|
|
|
36cfb7 |
@@ -208,6 +208,8 @@ static inline void __jiffies_to_tv(struct timeval *tv, unsigned long jiffies)
|
|
|
36cfb7 |
int print_timestamp(FILE *fp);
|
|
|
36cfb7 |
void print_nlmsg_timestamp(FILE *fp, const struct nlmsghdr *n);
|
|
|
36cfb7 |
|
|
|
36cfb7 |
+#define BIT(nr) (1UL << (nr))
|
|
|
36cfb7 |
+
|
|
|
36cfb7 |
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
|
|
36cfb7 |
|
|
|
36cfb7 |
#define BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)]))
|
|
|
36cfb7 |
--
|
|
|
36cfb7 |
2.20.1
|
|
|
36cfb7 |
|