From: Ming Lin Date: Tue, 7 Jun 2016 15:19:20 +0000 (+0200) Subject: Add macro helpers to common.h X-Git-Tag: v0.8~36 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d7bc1f7caae61d0f0139b95716aee7312c739ad2;p=users%2Fsagi%2Fnvme-cli.git Add macro helpers to common.h Signed-off-by: Ming Lin Reviewed-by: Christoph Hellwig Reviewed-and-tested-by: Sagi Grimberg Tested-by: Armen Baloyan --- diff --git a/common.h b/common.h new file mode 100644 index 00000000..639186d5 --- /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