Skip to content

Commit

Permalink
x86/pmstat: deal with Misra 8.4 violations
Browse files Browse the repository at this point in the history
While the override #define-s in x86_64/platform_hypercall.c are good for
the consuming side of the compat variants of set_{cx,px}_pminfo(), the
producers lack the respective declarations. Include pmstat.h early,
before the overrides are put in place, while adding explicit
declarations of the compat functions (alongside structure forward
declarations).

Reported-by: Andrew Cooper <[email protected]>
Signed-off-by: Jan Beulich <[email protected]>
Acked-by: Andrew Cooper <[email protected]>
Tested-by: Andrew Cooper <[email protected]>
  • Loading branch information
jbeulich authored and andyhhp committed Nov 19, 2024
1 parent a1ed107 commit 6308301
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xen/arch/x86/x86_64/platform_hypercall.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

EMIT_FILE;

#include <xen/lib.h>
#include <xen/hypercall.h>
#include <xen/pmstat.h>

#define xen_platform_op compat_platform_op
#define xen_platform_op_t compat_platform_op_t
Expand Down
8 changes: 8 additions & 0 deletions xen/include/xen/pmstat.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@

int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *perf);
long set_cx_pminfo(uint32_t acpi_id, struct xen_processor_power *power);

#ifdef CONFIG_COMPAT
struct compat_processor_performance;
int compat_set_px_pminfo(uint32_t acpi_id, struct compat_processor_performance *perf);
struct compat_processor_power;
long compat_set_cx_pminfo(uint32_t acpi_id, struct compat_processor_power *power);
#endif

uint32_t pmstat_get_cx_nr(unsigned int cpu);
int pmstat_get_cx_stat(unsigned int cpu, struct pm_cx_stat *stat);
int pmstat_reset_cx_stat(unsigned int cpu);
Expand Down

0 comments on commit 6308301

Please sign in to comment.