summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2009-05-07 14:57:19 -0700
committerInaky Perez-Gonzalez <inaky@linux.intel.com>2009-05-07 14:57:19 -0700
commite5360b66d45577cc8582dda0c952fa539d65bbd9 (patch)
treeff81cb69339c2f8d87321966c1563b01f1cf8bd1
parentb2aa3f8977ea67520bcb666881eb74b9f8d7ac4b (diff)
libwimaxll: add WIMAXLL_ALIGN2() to align values to powers-of-two
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
-rw-r--r--include/wimaxll.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/wimaxll.h b/include/wimaxll.h
index 5c4f4e2..ece869b 100644
--- a/include/wimaxll.h
+++ b/include/wimaxll.h
@@ -568,4 +568,11 @@ unsigned long wimaxll_be32_to_cpu(unsigned long be32)
return cpu;
}
+
+#define __WIMAXLL_ALIGN2_MASK(n, m) (((n) + (m)) & ~(m))
+/**
+ * Return the value \e n aligned to an order-of-two value \a o2.
+ */
+#define WIMAXLL_ALIGN2(n, o2) __WIMAXLL_ALIGN2_MASK(n, (typeof(n)) (o2) - 1)
+
#endif /* #ifndef __lib_wimaxll_h__ */