Skip to content

Commit

Permalink
libutils: util.h: fix indentation of ROUNDDOWN() macro
Browse files Browse the repository at this point in the history
Fix indentation of the value defined for ROUNDDOWN() macro
and add inline comment to better highlight the surrounded
macros are defined for assembler and like source files.

Signed-off-by: Etienne Carriere <[email protected]>
Reviewed-by: Jens Wiklander <[email protected]>
  • Loading branch information
etienne-lms committed Dec 19, 2024
1 parent 38b1e96 commit c09151c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/libutils/ext/include/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@
(__extension__ ({ __typeof__(x) _x = (x); \
__typeof__(y) _y = (y); \
(_x + (_y / 2)) / _y; }))
#else
#else /* __ASSEMBLER__ */
#define ROUNDUP(x, y) ((((x) + (y) - 1) / (y)) * (y))
#define ROUNDDOWN(x, y) (((x) / (y)) * (y))
#define ROUNDDOWN(x, y) (((x) / (y)) * (y))
#define UDIV_ROUND_NEAREST(x, y) (((x) + ((y) / 2)) / (y))
#endif
#endif /* __ASSEMBLER__ */

/* x has to be of an unsigned type */
#define IS_POWER_OF_TWO(x) (((x) != 0) && (((x) & (~(x) + 1)) == (x)))
Expand Down

0 comments on commit c09151c

Please sign in to comment.