Skip to content

Commit

Permalink
math: remove is_power_of_2() keep IS_POWER_OF_2()
Browse files Browse the repository at this point in the history
Caused it may conflict with other platfrom

Signed-off-by: ligd <[email protected]>
  • Loading branch information
GUIDINGLI committed Oct 7, 2024
1 parent 6869a05 commit 43e1d0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/clk/clk_divider.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ static int32_t divider_get_val(uint32_t rate, uint32_t parent_rate,

div = div_round_up(parent_rate, rate);

if ((flags & CLK_DIVIDER_POWER_OF_TWO) && !is_power_of_2(div))
if ((flags & CLK_DIVIDER_POWER_OF_TWO) && !IS_POWER_OF_2(div))
{
return -EINVAL;
}
Expand Down
3 changes: 1 addition & 2 deletions include/nuttx/lib/math32.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ extern "C"
* Public Function Prototypes
****************************************************************************/

#define is_power_of_2(n) IS_POWER_OF_2(n)
#define flsx(n) ((sizeof(n) <= sizeof(long)) ? flsl(n) : flsll(n))

/****************************************************************************
Expand All @@ -131,7 +130,7 @@ extern "C"
*
****************************************************************************/

#define log2ceil(n) (is_power_of_2(n) ? (flsx(n) - 1) : flsx(n))
#define log2ceil(n) (IS_POWER_OF_2(n) ? (flsx(n) - 1) : flsx(n))

/****************************************************************************
* Name: log2floor
Expand Down

0 comments on commit 43e1d0e

Please sign in to comment.