Simplify pcf_labels type

This commit is contained in:
Rodrigo Arias 2023-03-20 15:41:58 +01:00 committed by Rodrigo Arias Mallo
parent eaafd916be
commit 0bdfea309a
7 changed files with 14 additions and 14 deletions

View File

@ -42,8 +42,8 @@ static const struct pcf_value_label kernel_cs_values[] = {
{ -1, NULL },
};
static const struct pcf_value_label (*pcf_labels[CH_MAX])[] = {
[CH_CS] = &kernel_cs_values,
static const struct pcf_value_label *pcf_labels[CH_MAX] = {
[CH_CS] = kernel_cs_values,
};
static const long prv_flags[CH_MAX] = {

View File

@ -13,12 +13,12 @@ static int
create_values(const struct model_pvt_spec *pvt,
struct pcf_type *t, int i)
{
const struct pcf_value_label(*q)[] = pvt->label[i];
const struct pcf_value_label *q = pvt->label[i];
if (q == NULL)
return 0;
for (const struct pcf_value_label *p = *q; p->label != NULL; p++)
for (const struct pcf_value_label *p = q; p->label != NULL; p++)
pcf_add_value(t, p->value, p->label);
return 0;

View File

@ -13,7 +13,7 @@ struct model_pvt_spec {
const char **prefix;
const char **suffix;
const long *flags;
const struct pcf_value_label (**label)[];
const struct pcf_value_label **label;
};
#include "model_cpu.h"

View File

@ -98,9 +98,9 @@ static const struct pcf_value_label nanos6_thread_type[] = {
{ -1, NULL },
};
static const struct pcf_value_label (*pcf_labels[CH_MAX])[] = {
[CH_SUBSYSTEM] = &nanos6_ss_values,
[CH_THREAD] = &nanos6_thread_type,
static const struct pcf_value_label *pcf_labels[CH_MAX] = {
[CH_SUBSYSTEM] = nanos6_ss_values,
[CH_THREAD] = nanos6_thread_type,
};
static const long prv_flags[CH_MAX] = {

View File

@ -50,8 +50,8 @@ static const struct pcf_value_label nodes_ss_values[] = {
{ -1, NULL },
};
static const struct pcf_value_label (*pcf_labels[CH_MAX])[] = {
[CH_SUBSYSTEM] = &nodes_ss_values,
static const struct pcf_value_label *pcf_labels[CH_MAX] = {
[CH_SUBSYSTEM] = nodes_ss_values,
};
static const long prv_flags[CH_MAX] = {

View File

@ -77,8 +77,8 @@ static const struct pcf_value_label nosv_ss_values[] = {
{ -1, NULL },
};
static const struct pcf_value_label (*pcf_labels[CH_MAX])[] = {
[CH_SUBSYSTEM] = &nosv_ss_values,
static const struct pcf_value_label *pcf_labels[CH_MAX] = {
[CH_SUBSYSTEM] = nosv_ss_values,
};
static const long prv_flags[CH_MAX] = {

View File

@ -41,8 +41,8 @@ static const struct pcf_value_label flushing_values[] = {
{ -1, NULL },
};
static const struct pcf_value_label (*pcf_labels[CH_MAX])[] = {
[CH_FLUSH] = &flushing_values,
static const struct pcf_value_label *pcf_labels[CH_MAX] = {
[CH_FLUSH] = flushing_values,
};
static const long prv_flags[CH_MAX] = {