Displaying 2 results from an estimated 2 matches for "__align_mask".
2018 Sep 17
0
Re: [PATCH nbdkit v2] common: isaligned: Use a macro instead of relying on implicit truncation.
...s is not used in tight loops, so there is no reason to use a macro.
If you want to use a macro, see the kernel align macros:
57 /* @a is a power of 2 value */
58 #define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
59 #define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a))
60 #define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask))
61 #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
62 #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
>
> #endif /* NBDKIT_ISALIGNED_H */
> diff --git a/plugins/file/file.c b/plugins/file/fil...
2018 Sep 17
4
[PATCH nbdkit v2] common: isaligned: Use a macro instead of relying on implicit truncation.
---
common/include/isaligned.h | 11 +++++------
plugins/file/file.c | 4 ++--
plugins/vddk/vddk.c | 8 ++++----
3 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/common/include/isaligned.h b/common/include/isaligned.h
index e693820..81ce8a7 100644
--- a/common/include/isaligned.h
+++ b/common/include/isaligned.h
@@ -36,16 +36,15 @@
#include <assert.h>