All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
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 v6 iproute2 1/8] utils: Move BIT macro to common header
Date: Sun, 20 Aug 2017 12:58:21 +0300	[thread overview]
Message-ID: <20170820095828.13812-2-leon@kernel.org> (raw)
In-Reply-To: <20170820095828.13812-1-leon@kernel.org>

From: Leon Romanovsky <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 565bda60..1bb6d6a2 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -196,6 +196,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)]))
-- 
2.14.1

  reply	other threads:[~2017-08-20  9:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-20  9:58 [PATCH v6 iproute2 0/8] RDMAtool Leon Romanovsky
2017-08-20  9:58 ` Leon Romanovsky [this message]
2017-08-20  9:58 ` [PATCH v6 iproute2 2/8] rdma: Add basic infrastructure for RDMA tool Leon Romanovsky
2017-08-20  9:58 ` [PATCH v6 iproute2 3/8] rdma: Add dev object Leon Romanovsky
2017-08-20  9:58 ` [PATCH v6 iproute2 4/8] rdma: Add link object Leon Romanovsky
     [not found] ` <20170820095828.13812-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-08-20  9:58   ` [PATCH v6 iproute2 5/8] rdma: Add json and pretty outputs Leon Romanovsky
2017-08-20  9:58 ` [PATCH v6 iproute2 6/8] rdma: Implement json output for dev object Leon Romanovsky
2017-08-20  9:58 ` [PATCH v6 iproute2 7/8] rdma: Add json output to link object Leon Romanovsky
2017-08-20  9:58 ` [PATCH v6 iproute2 8/8] rdma: Add initial manual for the tool Leon Romanovsky
2017-08-22  0:11 ` [PATCH v6 iproute2 0/8] RDMAtool Stephen Hemminger

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=20170820095828.13812-2-leon@kernel.org \
    --to=leon@kernel.org \
    --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=leonro@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.