[PATCH v7 0/5] power: refactor power management library
Stephen Hemminger
stephen at networkplumber.org
Tue Oct 22 03:34:50 CEST 2024
On Mon, 21 Oct 2024 04:07:18 +0000
Sivaprasad Tummala <sivaprasad.tummala at amd.com> wrote:
> This patchset refactors the power management library, addressing both
> core and uncore power management. The primary changes involve the
> creation of dedicated directories for each driver within
> 'drivers/power/core/*' and 'drivers/power/uncore/*'.
>
> This refactor significantly improves code organization, enhances
> clarity, and boosts maintainability. It lays the foundation for more
> focused development on individual drivers and facilitates seamless
> integration of future enhancements, particularly the AMD uncore driver.
>
> Furthermore, this effort aims to streamline code maintenance by
> consolidating common functions for cpufreq and cppc across various
> core drivers, thus reducing code duplication.
Looks good, a couple of minor things you could address later in other comments.
One other thing in the power internals would be to change:
int open_core_sysfs_file(FILE **f, const char *mode, const char *format, ...)
__rte_format_printf(3, 4);
to be similar to existing fopen()
FILE *fopen_sysfs_file(const char *mode, const char *format, ...)
__rte_format_printf(2, 3) __rte_malloc __rte_dealloc(fclose, 1)
That would catch if the file pointer was not handled correctly.
Series-Acked-by: Stephen Hemminger <stephen at networkplumber.org>
More information about the dev
mailing list