This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch releases/12.7
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/releases/12.7 by this push:
new a965e3c3f9 math: remove is_power_of_2() keep IS_POWER_OF_2()
a965e3c3f9 is described below
commit a965e3c3f904e8e6e6a6d50e760f7ef75aa1b981
Author: ligd <[email protected]>
AuthorDate: Mon Oct 7 15:53:28 2024 +0800
math: remove is_power_of_2() keep IS_POWER_OF_2()
Caused it may conflict with other platfrom
Signed-off-by: ligd <[email protected]>
---
drivers/clk/clk_divider.c | 2 +-
include/nuttx/lib/math32.h | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/clk_divider.c b/drivers/clk/clk_divider.c
index 96fd643141..7490e3dd4a 100644
--- a/drivers/clk/clk_divider.c
+++ b/drivers/clk/clk_divider.c
@@ -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;
}
diff --git a/include/nuttx/lib/math32.h b/include/nuttx/lib/math32.h
index 5a728d46fb..26e7c0e15a 100644
--- a/include/nuttx/lib/math32.h
+++ b/include/nuttx/lib/math32.h
@@ -112,7 +112,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))
/****************************************************************************
@@ -129,7 +128,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