From: Leon Romanovsky <leonro@mellanox.com>
To: Doug Ledford <dledford@redhat.com>,
Stephen Hemminger <stephen@networkplumber.org>
Cc: linux-rdma@vger.kernel.org, Leon Romanovsky <leonro@mellanox.com>,
Dennis Dalessandro <dennis.dalessandro@intel.com>,
Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
Jiri Pirko <jiri@mellanox.com>, Ariel Almog <ariela@mellanox.com>,
David Laight <David.Laight@ACULAB.COM>,
Linux Netdev <netdev@vger.kernel.org>
Subject: [PATCH REPOST v5 iproute2 1/8] utils: Move BIT macro to common header
Date: Thu, 17 Aug 2017 09:56:07 +0300 [thread overview]
Message-ID: <20170817065614.1393-2-leonro@mellanox.com> (raw)
In-Reply-To: <20170817065614.1393-1-leonro@mellanox.com>
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 | 2 +-
include/utils.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index f9bc16c3..7602970b 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -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)
diff --git a/include/utils.h b/include/utils.h
index 6080b962..7a3b3fd2 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -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)]))
next prev parent reply other threads:[~2017-08-17 6:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-17 6:56 [PATCH REPOST v5 iproute2 0/8] RDMAtool Leon Romanovsky
2017-08-17 6:56 ` Leon Romanovsky [this message]
2017-08-17 6:56 ` [PATCH REPOST v5 iproute2 2/8] rdma: Add basic infrastructure for RDMA tool Leon Romanovsky
2017-08-17 6:56 ` [PATCH REPOST v5 iproute2 3/8] rdma: Add dev object Leon Romanovsky
2017-08-17 6:56 ` [PATCH REPOST v5 iproute2 4/8] rdma: Add link object Leon Romanovsky
2017-08-17 6:56 ` [PATCH REPOST v5 iproute2 5/8] rdma: Add json and pretty outputs Leon Romanovsky
2017-08-17 6:56 ` [PATCH REPOST v5 iproute2 6/8] rdma: Implement json output for dev object Leon Romanovsky
2017-08-17 6:56 ` [PATCH REPOST v5 iproute2 7/8] rdma: Add json output to link object Leon Romanovsky
2017-08-17 6:56 ` [PATCH REPOST v5 iproute2 8/8] rdma: Add initial manual for the tool Leon Romanovsky
[not found] ` <20170817065614.1393-1-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-08-18 1:01 ` [PATCH REPOST v5 iproute2 0/8] RDMAtool Stephen Hemminger
2017-08-18 4:45 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170817065614.1393-2-leonro@mellanox.com \
--to=leonro@mellanox.com \
--cc=David.Laight@ACULAB.COM \
--cc=ariela@mellanox.com \
--cc=dennis.dalessandro@intel.com \
--cc=dledford@redhat.com \
--cc=jgunthorpe@obsidianresearch.com \
--cc=jiri@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.