Skip to content

Commit fb2f03e

Browse files
committed
hw/psi-p9: Make interrupt name array global
The array of P9 PSI interrupt names is currently a static constant inside psi_p9_irq_name(). We'd like to use these names in another function so move it outside. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Cédric Le Goater <clg@kaod.org>
1 parent 4017085 commit fb2f03e

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

hw/psi.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,23 @@ static const struct irq_source_ops psi_p8_irq_ops = {
514514
.name = psi_p8_irq_name,
515515
};
516516

517+
static const char *psi_p9_irq_names[P9_PSI_NUM_IRQS] = {
518+
"fsp",
519+
"occ",
520+
"fsi",
521+
"lpchc",
522+
"local_err",
523+
"global_err",
524+
"external",
525+
"lpc_serirq_mux0", /* Have a callback to get name ? */
526+
"lpc_serirq_mux1", /* Have a callback to get name ? */
527+
"lpc_serirq_mux2", /* Have a callback to get name ? */
528+
"lpc_serirq_mux3", /* Have a callback to get name ? */
529+
"i2c",
530+
"dio",
531+
"psu"
532+
};
533+
517534
static void psihb_p9_interrupt(struct irq_source *is, uint32_t isn)
518535
{
519536
struct psi *psi = is->data;
@@ -594,28 +611,11 @@ static char *psi_p9_irq_name(struct irq_source *is, uint32_t isn)
594611
uint32_t idx = isn - psi->interrupt;
595612
char tmp[30];
596613

597-
static const char *names[P9_PSI_NUM_IRQS] = {
598-
"fsp",
599-
"occ",
600-
"fsi",
601-
"lpchc",
602-
"local_err",
603-
"global_err",
604-
"external",
605-
"lpc_serirq_mux0", /* Have a callback to get name ? */
606-
"lpc_serirq_mux1", /* Have a callback to get name ? */
607-
"lpc_serirq_mux2", /* Have a callback to get name ? */
608-
"lpc_serirq_mux3", /* Have a callback to get name ? */
609-
"i2c",
610-
"dio",
611-
"psu"
612-
};
613-
614-
if (idx >= ARRAY_SIZE(names))
614+
if (idx >= ARRAY_SIZE(psi_p9_irq_names))
615615
return NULL;
616616

617617
snprintf(tmp, sizeof(tmp), "psi#%x:%s",
618-
psi->chip_id, names[idx]);
618+
psi->chip_id, psi_p9_irq_names[idx]);
619619

620620
return strdup(tmp);
621621
}

0 commit comments

Comments
 (0)