[common] array: add ALIGN_PAD macro for common logic

ALIGN_PAD(x, a) returns x rounded up to the nearest multiple of a.
This commit is contained in:
Quantum authored and Geoffrey McRae committed 2021-08-14 08:05:29 +10:00
1 parent 712dcee07f
commit e5d252290d
3 files changed
+5 -2

No files matched your search

+1
View File
@@ -22,5 +22,6 @@
#define _LG_ARRAY_H_
#define ARRAY_LENGTH(arr) (sizeof(arr) / sizeof(*(arr)))
#define ALIGN_PAD(value, align) (((value) + (align) - 1) & -(align))
#endif