Skip to content

Commit

Permalink
macro/align: Fix ALIGN_UP and ALIGN_DOWN
Browse files Browse the repository at this point in the history
Signed-off-by: wangmingrong1 <[email protected]>
  • Loading branch information
W-M-R committed Jan 10, 2025
1 parent e5e9032 commit 420f76e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/nuttx/nuttx.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
#endif

#ifndef ALIGN_UP
# define ALIGN_UP(x,a) (((x) + ((a) - 1)) & ~((a) - 1))
# define ALIGN_UP(x,a) ((((x) + (a) - 1) / (a)) * (a))
#endif

#ifndef ALIGN_UP_MASK
# define ALIGN_UP_MASK(x,m) (((x) + (m)) & ~(m))
#endif

#ifndef ALIGN_DOWN
# define ALIGN_DOWN(x,a) ((x) & (~((a) - 1)))
# define ALIGN_DOWN(x,a) (((x) / (a)) * (a))
#endif

#ifndef ALIGN_DOWN_MASK
Expand Down

0 comments on commit 420f76e

Please sign in to comment.