[PATCH] irqchip/gicv3-its: comfort build warnings

From: Alex Shi
Date: Wed Sep 02 2015 - 01:16:26 EST


There are some warnings in gicv3-its.
It looks like they are set in its_lpi_alloc_chunks(), but
in fact, both of them(lpi_base/nr_lpis) still have some chances
as unset variables. Anyway to comfort gcc if it's not a issue.

drivers/irqchip/irq-gic-v3-its.c: In function âits_msi_prepareâ:
drivers/irqchip/irq-gic-v3-its.c:1148:26: warning: âlpi_baseâ may be used uninitialized in this function [-Wmaybe-uninitialized]
dev->event_map.lpi_base = lpi_base;
^
drivers/irqchip/irq-gic-v3-its.c:1116:6: note: âlpi_baseâ was declared here
int lpi_base;
^
drivers/irqchip/irq-gic-v3-its.c:1149:25: warning: ânr_lpisâ may be used uninitialized in this function [-Wmaybe-uninitialized]
dev->event_map.nr_lpis = nr_lpis;
^
drivers/irqchip/irq-gic-v3-its.c:1117:6: note: ânr_lpisâ was declared here
int nr_lpis;
^

Signed-off-by: Alex Shi <alex.shi@xxxxxxxxxx>
Cc: Marc Zyngier <marc.zyngier@xxxxxxx>
Cc: Jason Cooper <jason@xxxxxxxxxxxxxx>
---
drivers/irqchip/irq-gic-v3-its.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 26b55c5..0f0af18 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1113,8 +1113,8 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id,
unsigned long flags;
u16 *col_map = NULL;
void *itt;
- int lpi_base;
- int nr_lpis;
+ int lpi_base = 0;
+ int nr_lpis = 0;
int nr_ites;
int sz;

--
2.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/