@@ -17,6 +17,7 @@
#include <limits.h>
#include <syslog.h>
#include <util/log.h>
+#include <util/size.h>
#include <uuid/uuid.h>
#include <util/json.h>
#include <util/filter.h>
@@ -605,8 +606,6 @@ static struct namespace_label *label_base(struct nvdimm_data *ndd)
return (struct namespace_label *) base;
}
-#define ALIGN(x, a) ((((unsigned long long) x) + (a - 1)) & ~(a - 1))
-#define BITS_PER_LONG (sizeof(unsigned long) * 8)
static int label_write_index(struct nvdimm_data *ndd, int index, u32 seq)
{
struct namespace_index *nsindex;
@@ -11,11 +11,10 @@
#include <stdlib.h>
#include <linux/fs.h>
#include <test.h>
+#include <util/size.h>
#include <linux/fiemap.h>
#define NUM_EXTENTS 5
-#define HPAGE_SIZE (2 << 20)
-#define ALIGN(x, a) ((((unsigned long long) x) + (a - 1)) & ~(a - 1))
#define fail() fprintf(stderr, "%s: failed at: %d\n", __func__, __LINE__)
#define faili(i) fprintf(stderr, "%s: failed at: %d: %d\n", __func__, __LINE__, i)
#define TEST_FILE "test_dax_data"
@@ -14,4 +14,8 @@
unsigned long long parse_size64(const char *str);
unsigned long long __parse_size64(const char *str, unsigned long long *units);
+#define ALIGN(x, a) ((((unsigned long long) x) + (a - 1)) & ~(a - 1))
+#define BITS_PER_LONG (sizeof(unsigned long) * 8)
+#define HPAGE_SIZE (2 << 20)
+
#endif /* _NDCTL_SIZE_H_ */
There are a couple locations where we locally define ALIGN(), add a global definition before adding another local one. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- ndctl/builtin-dimm.c | 3 +-- test/dax-pmd.c | 3 +-- util/size.h | 4 ++++ 3 files changed, 6 insertions(+), 4 deletions(-)