From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752826AbbJBSzM (ORCPT ); Fri, 2 Oct 2015 14:55:12 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49836 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750844AbbJBSzJ (ORCPT ); Fri, 2 Oct 2015 14:55:09 -0400 Date: Fri, 2 Oct 2015 11:54:41 -0700 From: tip-bot for Marc Zyngier Message-ID: Cc: mingo@kernel.org, ard.biesheuvel@linaro.org, linux-kernel@vger.kernel.org, ddaney.cavm@gmail.com, jason@lakedaemon.net, marc.zyngier@arm.com, hpa@zytor.com, alex.shi@linaro.org, tglx@linutronix.de Reply-To: mingo@kernel.org, ard.biesheuvel@linaro.org, linux-kernel@vger.kernel.org, marc.zyngier@arm.com, hpa@zytor.com, ddaney.cavm@gmail.com, jason@lakedaemon.net, tglx@linutronix.de, alex.shi@linaro.org In-Reply-To: <1443800646-8074-2-git-send-email-marc.zyngier@arm.com> References: <1443800646-8074-2-git-send-email-marc.zyngier@arm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/urgent] irqchip/gic-v3-its: Silence warning when its_lpi_alloc_chunks gets inlined Git-Commit-ID: c8415b9470727f70afce8607d4fe521789aa6c1c X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: c8415b9470727f70afce8607d4fe521789aa6c1c Gitweb: http://git.kernel.org/tip/c8415b9470727f70afce8607d4fe521789aa6c1c Author: Marc Zyngier AuthorDate: Fri, 2 Oct 2015 16:44:05 +0100 Committer: Thomas Gleixner CommitDate: Fri, 2 Oct 2015 20:51:41 +0200 irqchip/gic-v3-its: Silence warning when its_lpi_alloc_chunks gets inlined More agressive inlining in recent versions of GCC have uncovered a new set of warnings: 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; ^ The warning is fairly benign (there is no code path that could actually use uninitialized variables), but let's silence it anyway by zeroing the variables on the error path. Reported-by: Alex Shi Tested-by: Ard Biesheuvel Signed-off-by: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org Cc: David Daney Cc: Jason Cooper Link: http://lkml.kernel.org/r/1443800646-8074-2-git-send-email-marc.zyngier@arm.com Signed-off-by: Thomas Gleixner --- drivers/irqchip/irq-gic-v3-its.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index ac7ae2b..25ceae9f 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -719,6 +719,9 @@ static unsigned long *its_lpi_alloc_chunks(int nr_irqs, int *base, int *nr_ids) out: spin_unlock(&lpi_lock); + if (!bitmap) + *base = *nr_ids = 0; + return bitmap; }