diff --git a/inc/fdb_low_lvl.h b/inc/fdb_low_lvl.h index 160db75..b2cdd0d 100644 --- a/inc/fdb_low_lvl.h +++ b/inc/fdb_low_lvl.h @@ -29,7 +29,7 @@ /* Return the most contiguous size aligned at specified width. RT_ALIGN(13, 4) * would return 16. */ -#define FDB_ALIGN(size, align) (((size) + (align) - 1) & ~((align) - 1)) +#define FDB_ALIGN(size, align) ((size + align - 1) - ((size + align -1) % align)) /* align by write granularity */ #define FDB_WG_ALIGN(size) (FDB_ALIGN(size, (FDB_WRITE_GRAN + 7)/8)) /**