[PATCH 04/11] Add macro helpers to common.h
Christoph Hellwig
hch at lst.de
Tue Jun 7 08:19:20 PDT 2016
From: Ming Lin <ming.l at ssi.samsung.com>
Signed-off-by: Ming Lin <ming.l at ssi.samsung.com>
Reviewed-by: Christoph Hellwig <hch at lst.de>
Reviewed-and-tested-by: Sagi Grimberg <sagi at grimberg.me>
Tested-by: Armen Baloyan <armenx.baloyan at intel.com>
---
common.h | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 common.h
diff --git a/common.h b/common.h
new file mode 100644
index 0000000..639186d
--- /dev/null
+++ b/common.h
@@ -0,0 +1,9 @@
+#ifndef _COMMON_H
+#define _COMMON_H
+
+#define offsetof(x, y) __builtin_offsetof(x, y)
+
+#define __round_mask(x, y) ((__typeof__(x))((y)-1))
+#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
+
+#endif
--
2.1.4
More information about the Linux-nvme
mailing list