Index: generic/include/align.h
===================================================================
--- generic/include/align.h	(revision b87f41860c88213bb9dc599f59adedde6615550b)
+++ generic/include/align.h	(revision 9d5e23cc7bc9f1f8f9799b82cd567c045c657dd3)
@@ -30,17 +30,18 @@
 #define __ALIGN_H__
 
+/** Align to the nearest lower address.
+ *
+ * @param s Address or size to be aligned.
+ * @param a Size of alignment, must be power of 2.
+ */
+#define ALIGN_DOWN(s, a)	((s) & ~((a) - 1))
+
+
 /** Align to the nearest higher address.
  *
  * @param s Address or size to be aligned.
- * @param a Size of alignment.
+ * @param a Size of alignment, must be power of 2.
  */
-#define ALIGN_UP(s, a)		((s) % (a) ? (((s) / (a)) + 1) * (a) : (s))
-
-/** Align to the nearest lower address.
- *
- * @param s Address or size to be aligned.
- * @param a Size of alignment.
- */
-#define ALIGN_DOWN(s, a)	((s) & ~((a)-1))
+#define ALIGN_UP(s, a)		((s + ((a) - 1)) & ~((a) - 1))
 
 #endif
