]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Add macro helpers to common.h
authorMing Lin <ming.l@ssi.samsung.com>
Tue, 7 Jun 2016 15:19:20 +0000 (17:19 +0200)
committerKeith Busch <keith.busch@intel.com>
Tue, 7 Jun 2016 19:07:14 +0000 (13:07 -0600)
Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-and-tested-by: Sagi Grimberg <sagi@grimberg.me>
Tested-by: Armen Baloyan <armenx.baloyan@intel.com>
common.h [new file with mode: 0644]

diff --git a/common.h b/common.h
new file mode 100644 (file)
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