Skip to contentSkip to conversation

irqchip/loongson-htpic: Fix build warnings

PATCH New Huacai Chen 1 participant 1 message Dec 5, 2020

Subsystems (3)
lore
Share & tools
lore

Huacai Chen

author maintainer
#0 lore raw

PATCH 1/1 irqchip/loongson-htpic: Fix build warnings

Fix build warnings as below:

drivers/irqchip/irq-loongson-htpic.c: In function 'htpic_reg_init':

Quoted 1 line
Quoted 1 line

drivers/irqchip/irq-loongson-htpic.c:62:12: warning: variable 'val' set but not used [-Wunused-but-set-variable]

      62 |   uint32_t val;
         |            ^~~

drivers/irqchip/irq-loongson-htpic.c: At top level:

Quoted 1 line
Quoted 1 line

drivers/irqchip/irq-loongson-htpic.c:84:12: warning: no previous prototype for 'htpic_of_init' [-Wmissing-prototypes]

84 | int __init htpic_of_init(struct device_node *node, struct device_node *parent)
| ^~~~~~~~~~~~~

Fixes a93f1d903fa34fc2c5d9fa450bd ("irqchip: Add driver for Loongson-3 HyperTransport PIC controller")
---
 drivers/irqchip/irq-loongson-htpic.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/irqchip/irq-loongson-htpic.c +3 -4
index 63f7280..1b801c4 100644
@@ -59,11 +59,10 @@ static void htpic_reg_init(void)
 	int i;
 
 	for (i = 0; i < HTINT_NUM_VECTORS; i++) {
-		uint32_t val;
-
 		/* Disable all HT Vectors */
 		writel(0x0, htpic->base + HTINT_EN_OFF + i * 0x4);
-		val = readl(htpic->base + i * 0x4);
+		/* Read back to force write */
+		(void) readl(htpic->base + i * 0x4);
 		/* Ack all possible pending IRQs */
 		writel(GENMASK(31, 0), htpic->base + i * 0x4);
 	}
@@ -81,7 +80,7 @@ struct syscore_ops htpic_syscore_ops = {
 	.resume		= htpic_resume,
 };
 
-int __init htpic_of_init(struct device_node *node, struct device_node *parent)
+static int __init htpic_of_init(struct device_node *node, struct device_node *parent)
 {
 	unsigned int parent_irq[4];
 	int i, err;
Signature · 1 line
2.7.0