From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: David Hunt <david.hunt@intel.com>, dev@dpdk.org
Cc: Richael.Zhuang@arm.com, stephen@networkplumber.org,
reshma.pattan@intel.com, nd@arm.com
Subject: Re: [dpdk-dev] [PATCH v6 2/2] power: refactor pstate and acpi code
Date: Wed, 23 Jun 2021 13:27:21 +0100 [thread overview]
Message-ID: <b7f95aa5-4d72-5989-ba4f-c7670b79d163@intel.com> (raw)
In-Reply-To: <20210623120342.36321-2-david.hunt@intel.com>
On 23-Jun-21 1:03 PM, David Hunt wrote:
> From: Anatoly Burakov <anatoly.burakov@intel.com>
>
> Currently, ACPI and PSTATE modes have lots of code duplication,
> confusing logic, and a bunch of other issues that can, and have, led to
> various bugs and resource leaks.
>
> This commit factors out the common parts of sysfs reading/writing for
> ACPI and PSTATE drivers.
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Signed-off-by: David Hunt <david.hunt@intel.com>
>
> ---
> changes in v5
> * fixed bugs raised by Richael Zhuang in review - open file rw+, etc.
> * removed FOPS* and FOPEN* macros, which contained control statements.
> * fixed some checkpatch warnings.
> changes in v6
> * fixed check of fputs return, negative on error.
> ---
> lib/power/meson.build | 7 +
> lib/power/power_acpi_cpufreq.c | 192 ++++------------
> lib/power/power_common.c | 146 ++++++++++++
> lib/power/power_common.h | 17 ++
> lib/power/power_pstate_cpufreq.c | 374 ++++++++++---------------------
> 5 files changed, 335 insertions(+), 401 deletions(-)
>
> diff --git a/lib/power/meson.build b/lib/power/meson.build
> index c1097d32f1..74c5f3a294 100644
> --- a/lib/power/meson.build
> +++ b/lib/power/meson.build
> @@ -5,6 +5,13 @@ if not is_linux
> build = false
> reason = 'only supported on Linux'
> endif
> +
> +# we do some snprintf magic so silence format-nonliteral
> +flag_nonliteral = '-Wno-format-nonliteral'
> +if cc.has_argument(flag_nonliteral)
> + cflags += flag_nonliteral
> +endif
> +
I'll do a more thorough review later, but i suspect that we can drop
this, if we fix the functions to have a GCC printf format attribute:
https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Function-Attributes.html
See "format" section. I'm not sure this is supported by other compilers
though, so maybe it's better to keep it.
--
Thanks,
Anatoly
next prev parent reply other threads:[~2021-06-23 12:27 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-01 15:05 [dpdk-dev] [PATCH 21.08] power: refactor pstate sysfs handling Anatoly Burakov
2021-04-02 9:27 ` [dpdk-dev] [21.08 v2] " Anatoly Burakov
2021-04-02 17:45 ` [dpdk-dev] [PATCH 21.08] " Stephen Hemminger
2021-04-06 10:06 ` Burakov, Anatoly
2021-04-02 17:46 ` Stephen Hemminger
2021-04-06 10:05 ` Burakov, Anatoly
2021-04-22 15:08 ` [dpdk-dev] [21.08 PATCH v3 1/1] " Anatoly Burakov
2021-04-23 11:03 ` [dpdk-dev] [21.08 PATCH v4 1/2] power: don't use rte prefix in internal code Anatoly Burakov
2021-05-31 10:23 ` David Hunt
2021-06-22 12:43 ` [dpdk-dev] [PATCH v2 " David Hunt
2021-06-22 12:43 ` [dpdk-dev] [PATCH v2 2/2] power: refactor pstate and acpi code David Hunt
2021-06-22 13:00 ` David Hunt
2021-06-22 12:59 ` [dpdk-dev] [PATCH v2 1/2] power: don't use rte prefix in internal code David Hunt
2021-06-22 12:58 ` [dpdk-dev] [PATCH v5 " David Hunt
2021-06-22 12:58 ` [dpdk-dev] [PATCH v5 2/2] power: refactor pstate and acpi code David Hunt
2021-06-22 13:27 ` David Hunt
2021-06-23 8:54 ` Richael Zhuang
2021-06-23 9:00 ` David Hunt
2021-06-23 12:03 ` [dpdk-dev] [PATCH v6 1/2] power: don't use rte prefix in internal code David Hunt
2021-06-23 12:03 ` [dpdk-dev] [PATCH v6 2/2] power: refactor pstate and acpi code David Hunt
2021-06-23 12:27 ` Burakov, Anatoly [this message]
2021-06-30 5:32 ` Richael Zhuang
2021-07-08 12:49 ` David Marchand
2021-07-08 13:33 ` David Hunt
2021-07-08 15:38 ` [dpdk-dev] [PATCH v7 1/2] power: don't use rte prefix in internal code David Hunt
2021-07-08 15:38 ` [dpdk-dev] [PATCH v7 2/2] power: refactor pstate and acpi code David Hunt
2021-07-08 20:41 ` [dpdk-dev] [PATCH v7 1/2] power: don't use rte prefix in internal code David Marchand
2021-04-23 11:03 ` [dpdk-dev] [21.08 PATCH v4 2/2] power: refactor pstate and acpi code Anatoly Burakov
2021-05-07 2:13 ` Richael Zhuang
2021-05-07 9:49 ` Burakov, Anatoly
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=b7f95aa5-4d72-5989-ba4f-c7670b79d163@intel.com \
--to=anatoly.burakov@intel.com \
--cc=Richael.Zhuang@arm.com \
--cc=david.hunt@intel.com \
--cc=dev@dpdk.org \
--cc=nd@arm.com \
--cc=reshma.pattan@intel.com \
--cc=stephen@networkplumber.org \
/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;
as well as URLs for NNTP newsgroup(s).