Simplify pcf_labels type
This commit is contained in:
parent
eaafd916be
commit
0bdfea309a
@ -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] = {
|
||||
|
@ -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;
|
||||
|
@ -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"
|
||||
|
@ -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] = {
|
||||
|
@ -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] = {
|
||||
|
@ -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] = {
|
||||
|
@ -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] = {
|
||||
|
Loading…
Reference in New Issue
Block a user