diff mbox

[ovs-dev,v4,13/22] Move a couple of bitmap macros to exportable header

Message ID e0930d6669d2a64c149571dbb1efef0af59c85d2.1458688105.git.ben@skyportsystems.com
State Superseded
Headers show

Commit Message

ben@skyportsystems.com March 22, 2016, 11:17 p.m. UTC
From: Ben Warren <ben@skyportsystems.com>

This allows lib/meta-flow.h to become exportable

Signed-off-by: Ben Warren <ben@skyportsystems.com>
---
 include/openvswitch/util.h | 4 ++++
 lib/bitmap.h               | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/include/openvswitch/util.h b/include/openvswitch/util.h
index cfafc36..2230b2a 100644
--- a/include/openvswitch/util.h
+++ b/include/openvswitch/util.h
@@ -191,6 +191,10 @@  is_pow2(uintmax_t x)
 #define RDP2_4(X) (RDP2_5(X) | (RDP2_5(X) >> 2))
 #define RDP2_5(X) (      (X) | (      (X) >> 1))
 
+/* Macros for sizing bitmaps */
+#define BITMAP_ULONG_BITS (sizeof(unsigned long) * CHAR_BIT)
+#define BITMAP_N_LONGS(N_BITS) DIV_ROUND_UP(N_BITS, BITMAP_ULONG_BITS)
+
 /* Given ATTR, and TYPE, cast the ATTR to TYPE by first casting ATTR to
  * (void *). This is to suppress the alignment warning issued by clang. */
 #define ALIGNED_CAST(TYPE, ATTR) ((TYPE) (void *) (ATTR))
diff --git a/lib/bitmap.h b/lib/bitmap.h
index d541bab..39b7597 100644
--- a/lib/bitmap.h
+++ b/lib/bitmap.h
@@ -21,8 +21,6 @@ 
 #include <stdlib.h>
 #include "util.h"
 
-#define BITMAP_ULONG_BITS (sizeof(unsigned long) * CHAR_BIT)
-
 static inline unsigned long *
 bitmap_unit__(const unsigned long *bitmap, size_t offset)
 {
@@ -35,8 +33,6 @@  bitmap_bit__(size_t offset)
     return 1UL << (offset % BITMAP_ULONG_BITS);
 }
 
-#define BITMAP_N_LONGS(N_BITS) DIV_ROUND_UP(N_BITS, BITMAP_ULONG_BITS)
-
 static inline size_t
 bitmap_n_longs(size_t n_bits)
 {