DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Huisong Li <lihuisong@huawei.com>
To: <anatoly.burakov@intel.com>, <sivaprasad.tummala@amd.com>
Cc: <dev@dpdk.org>, <thomas@monjalon.net>,
	<stephen@networkplumber.org>, <fengchengwen@huawei.com>,
	<yangxingui@huawei.com>, <zhanjie9@hisilicon.com>,
	 <lihuisong@huawei.com>
Subject: [PATCH 2/3] power: unify decimal format macro for strtoul
Date: Sat, 9 May 2026 16:45:02 +0800	[thread overview]
Message-ID: <20260509084503.2917038-3-lihuisong@huawei.com> (raw)
In-Reply-To: <20260509084503.2917038-1-lihuisong@huawei.com>

Unify and move POWER_CONVERT_TO_DECIMAL definition to common header
file to facilitate the use of drivers and library.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 drivers/power/acpi/acpi_cpufreq.c             | 1 -
 drivers/power/amd_pstate/amd_pstate_cpufreq.c | 2 --
 drivers/power/cppc/cppc_cpufreq.c             | 2 --
 lib/power/power_common.c                      | 1 -
 lib/power/power_common.h                      | 2 ++
 5 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/power/acpi/acpi_cpufreq.c b/drivers/power/acpi/acpi_cpufreq.c
index 21991af36a..875c66336d 100644
--- a/drivers/power/acpi/acpi_cpufreq.c
+++ b/drivers/power/acpi/acpi_cpufreq.c
@@ -14,7 +14,6 @@
 #include "power_common.h"
 
 #define STR_SIZE     1024
-#define POWER_CONVERT_TO_DECIMAL 10
 
 #define POWER_GOVERNOR_USERSPACE "userspace"
 #define POWER_SYSFILE_AVAIL_FREQ \
diff --git a/drivers/power/amd_pstate/amd_pstate_cpufreq.c b/drivers/power/amd_pstate/amd_pstate_cpufreq.c
index 318f8c00e1..bc67981d71 100644
--- a/drivers/power/amd_pstate/amd_pstate_cpufreq.c
+++ b/drivers/power/amd_pstate/amd_pstate_cpufreq.c
@@ -16,8 +16,6 @@
 #define FREQ_ROUNDING_DELTA 500
 #define ROUND_FREQ_TO_N_1000 1000
 
-#define POWER_CONVERT_TO_DECIMAL 10
-
 #define POWER_GOVERNOR_USERSPACE "userspace"
 #define POWER_SYSFILE_SETSPEED   \
 		"/sys/devices/system/cpu/cpu%u/cpufreq/scaling_setspeed"
diff --git a/drivers/power/cppc/cppc_cpufreq.c b/drivers/power/cppc/cppc_cpufreq.c
index e3ba9bb60a..9ae25bad27 100644
--- a/drivers/power/cppc/cppc_cpufreq.c
+++ b/drivers/power/cppc/cppc_cpufreq.c
@@ -20,8 +20,6 @@
  */
 #define UNIT_DIFF 10000
 
-#define POWER_CONVERT_TO_DECIMAL 10
-
 #define POWER_GOVERNOR_USERSPACE "userspace"
 #define POWER_SYSFILE_SETSPEED   \
 		"/sys/devices/system/cpu/cpu%u/cpufreq/scaling_setspeed"
diff --git a/lib/power/power_common.c b/lib/power/power_common.c
index 2da034e9d0..da22a4d160 100644
--- a/lib/power/power_common.c
+++ b/lib/power/power_common.c
@@ -21,7 +21,6 @@ RTE_LOG_REGISTER_DEFAULT(rte_power_logtype, INFO);
 		"/sys/devices/system/cpu/cpu%u/cpufreq/scaling_driver"
 #define POWER_SYSFILE_GOVERNOR  \
 		"/sys/devices/system/cpu/cpu%u/cpufreq/scaling_governor"
-#define POWER_CONVERT_TO_DECIMAL 10
 
 RTE_EXPORT_INTERNAL_SYMBOL(cpufreq_check_scaling_driver)
 int
diff --git a/lib/power/power_common.h b/lib/power/power_common.h
index 3f56b1103d..e2d5b68a17 100644
--- a/lib/power/power_common.h
+++ b/lib/power/power_common.h
@@ -23,6 +23,8 @@ extern int rte_power_logtype;
 #define POWER_DEBUG_LOG(...)
 #endif
 
+#define POWER_CONVERT_TO_DECIMAL 10
+
 /* check if scaling driver matches one we want */
 __rte_internal
 int cpufreq_check_scaling_driver(const char *driver);
-- 
2.33.0


  parent reply	other threads:[~2026-05-09  8:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-09  8:45 [PATCH 0/3] power: some cleancode for cpufreq library Huisong Li
2026-05-09  8:45 ` [PATCH 1/3] power: move power state structure to power cpufreq header Huisong Li
2026-05-09  8:45 ` Huisong Li [this message]
2026-05-09  8:45 ` [PATCH 3/3] power: use common decimal macro definition Huisong Li
2026-05-11  1:10 ` [PATCH 0/3] power: some cleancode for cpufreq library fengchengwen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260509084503.2917038-3-lihuisong@huawei.com \
    --to=lihuisong@huawei.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=sivaprasad.tummala@amd.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    --cc=yangxingui@huawei.com \
    --cc=zhanjie9@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox