Skip to content

Commit fda7409

Browse files
chenhuacaiMarc Zyngier
authored andcommitted
irqchip/loongson-pch-pic: Move find_pch_pic() into CONFIG_ACPI
MIPS doesn't declare find_pch_pic(), which makes a build warning: >> drivers/irqchip/irq-loongson-pch-pic.c:51:5: warning: no previous prototype for function 'find_pch_pic' [-Wmissing-prototypes] int find_pch_pic(u32 gsi) ^ drivers/irqchip/irq-loongson-pch-pic.c:51:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int find_pch_pic(u32 gsi) ^ static 1 warning generated. Move find_pch_pic() into CONFIG_ACPI which only used by LoongArch to fix the warning. BTW, remove the duplicated declaration of find_pch_pic() in irq.h. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220808093205.3658485-1-chenhuacai@loongson.cn
1 parent 54cfa91 commit fda7409

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

arch/loongarch/include/asm/irq.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ extern struct acpi_vector_group msi_group[MAX_IO_PICS];
8181
#define GSI_MIN_PCH_IRQ LOONGSON_PCH_IRQ_BASE
8282
#define GSI_MAX_PCH_IRQ (LOONGSON_PCH_IRQ_BASE + 256 - 1)
8383

84-
extern int find_pch_pic(u32 gsi);
8584
extern int eiointc_get_node(int id);
8685

8786
struct acpi_madt_lio_pic;

drivers/irqchip/irq-loongson-pch-pic.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,6 @@ static struct pch_pic *pch_pic_priv[MAX_IO_PICS];
4848

4949
struct fwnode_handle *pch_pic_handle[MAX_IO_PICS];
5050

51-
int find_pch_pic(u32 gsi)
52-
{
53-
int i;
54-
55-
/* Find the PCH_PIC that manages this GSI. */
56-
for (i = 0; i < MAX_IO_PICS; i++) {
57-
struct pch_pic *priv = pch_pic_priv[i];
58-
59-
if (!priv)
60-
return -1;
61-
62-
if (gsi >= priv->gsi_base && gsi < (priv->gsi_base + priv->vec_count))
63-
return i;
64-
}
65-
66-
pr_err("ERROR: Unable to locate PCH_PIC for GSI %d\n", gsi);
67-
return -1;
68-
}
69-
7051
static void pch_pic_bitset(struct pch_pic *priv, int offset, int bit)
7152
{
7253
u32 reg;
@@ -325,6 +306,25 @@ IRQCHIP_DECLARE(pch_pic, "loongson,pch-pic-1.0", pch_pic_of_init);
325306
#endif
326307

327308
#ifdef CONFIG_ACPI
309+
int find_pch_pic(u32 gsi)
310+
{
311+
int i;
312+
313+
/* Find the PCH_PIC that manages this GSI. */
314+
for (i = 0; i < MAX_IO_PICS; i++) {
315+
struct pch_pic *priv = pch_pic_priv[i];
316+
317+
if (!priv)
318+
return -1;
319+
320+
if (gsi >= priv->gsi_base && gsi < (priv->gsi_base + priv->vec_count))
321+
return i;
322+
}
323+
324+
pr_err("ERROR: Unable to locate PCH_PIC for GSI %d\n", gsi);
325+
return -1;
326+
}
327+
328328
static int __init
329329
pch_lpc_parse_madt(union acpi_subtable_headers *header,
330330
const unsigned long end)

0 commit comments

Comments
 (0)