From patchwork Sat Jan 2 17:58:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Lackorzynski X-Patchwork-Id: 356011 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D714C433DB for ; Sat, 2 Jan 2021 18:19:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69902207CD for ; Sat, 2 Jan 2021 18:19:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726627AbhABSTR (ORCPT ); Sat, 2 Jan 2021 13:19:17 -0500 Received: from os.inf.tu-dresden.de ([141.76.48.99]:44610 "EHLO os.inf.tu-dresden.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbhABSTQ (ORCPT ); Sat, 2 Jan 2021 13:19:16 -0500 Received: from erwin.inf.tu-dresden.de ([141.76.48.80] helo=l4re.org) by os.inf.tu-dresden.de with esmtp (Exim 4.94) id 1kvlB9-0007bz-TE; Sat, 02 Jan 2021 18:59:03 +0100 From: Adam Lackorzynski To: maz@kernel.org, tglx@linutronix.de Cc: linux-arm-kernel@lists.infradead.org, linusw@kernel.org, kaloz@openwrt.org, khalasa@piap.pl, andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, linux-gpio@vger.kernel.org, bgolaszewski@baylibre.com Subject: [PATCH 2/6] irqchip/armada-370-xp: Fix return check in IPI alloc Date: Sat, 2 Jan 2021 18:58:55 +0100 Message-Id: <20210102175859.335447-2-adam@l4re.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210102175859.335447-1-adam@l4re.org> References: <20210102175859.335447-1-adam@l4re.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org __irq_domain_alloc_irqs returns a negative error code upon failure, not only 0. Also use irq_domain_alloc_irqs to require less default arguments. Signed-off-by: Adam Lackorzynski --- drivers/irqchip/irq-armada-370-xp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 32938dfc0e46..b5e3aacdc2d1 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -430,9 +430,9 @@ static __init void armada_xp_ipi_init(struct device_node *node) return; irq_domain_update_bus_token(ipi_domain, DOMAIN_BUS_IPI); - base_ipi = __irq_domain_alloc_irqs(ipi_domain, -1, IPI_DOORBELL_END, - NUMA_NO_NODE, NULL, false, NULL); - if (WARN_ON(!base_ipi)) + base_ipi = irq_domain_alloc_irqs(ipi_domain, IPI_DOORBELL_END, + NUMA_NO_NODE, NULL); + if (WARN_ON(base_ipi <= 0)) return; set_smp_ipi_range(base_ipi, IPI_DOORBELL_END); From patchwork Sat Jan 2 17:58:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Lackorzynski X-Patchwork-Id: 356010 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79601C433DB for ; Sat, 2 Jan 2021 18:20:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A724207CD for ; Sat, 2 Jan 2021 18:20:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726636AbhABSUn (ORCPT ); Sat, 2 Jan 2021 13:20:43 -0500 Received: from os.inf.tu-dresden.de ([141.76.48.99]:44694 "EHLO os.inf.tu-dresden.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbhABSUn (ORCPT ); Sat, 2 Jan 2021 13:20:43 -0500 Received: from erwin.inf.tu-dresden.de ([141.76.48.80] helo=l4re.org) by os.inf.tu-dresden.de with esmtp (Exim 4.94) id 1kvlBA-0007bz-Dx; Sat, 02 Jan 2021 18:59:04 +0100 From: Adam Lackorzynski To: maz@kernel.org, tglx@linutronix.de Cc: linux-arm-kernel@lists.infradead.org, linusw@kernel.org, kaloz@openwrt.org, khalasa@piap.pl, andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, linux-gpio@vger.kernel.org, bgolaszewski@baylibre.com Subject: [PATCH 3/6] irqdomain/msi: Fix return check of __irq_domain_alloc_irqs Date: Sat, 2 Jan 2021 18:58:56 +0100 Message-Id: <20210102175859.335447-3-adam@l4re.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210102175859.335447-1-adam@l4re.org> References: <20210102175859.335447-1-adam@l4re.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 0 is not a proper IRQ number and also indicates failure. Signed-off-by: Adam Lackorzynski --- kernel/irq/msi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c index 2c0c4d6d0f83..e1fe832e7161 100644 --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -416,7 +416,7 @@ int __msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev, virq = __irq_domain_alloc_irqs(domain, -1, desc->nvec_used, dev_to_node(dev), &arg, false, desc->affinity); - if (virq < 0) { + if (virq <= 0) { ret = -ENOSPC; if (ops->handle_error) ret = ops->handle_error(domain, desc, ret); From patchwork Sat Jan 2 17:58:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Lackorzynski X-Patchwork-Id: 356009 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6915DC433E0 for ; Sat, 2 Jan 2021 18:22:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 31897207CD for ; Sat, 2 Jan 2021 18:22:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726642AbhABSWJ (ORCPT ); Sat, 2 Jan 2021 13:22:09 -0500 Received: from os.inf.tu-dresden.de ([141.76.48.99]:44910 "EHLO os.inf.tu-dresden.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbhABSWJ (ORCPT ); Sat, 2 Jan 2021 13:22:09 -0500 Received: from erwin.inf.tu-dresden.de ([141.76.48.80] helo=l4re.org) by os.inf.tu-dresden.de with esmtp (Exim 4.94) id 1kvlBA-0007bz-Ur; Sat, 02 Jan 2021 18:59:05 +0100 From: Adam Lackorzynski To: maz@kernel.org, tglx@linutronix.de Cc: linux-arm-kernel@lists.infradead.org, linusw@kernel.org, kaloz@openwrt.org, khalasa@piap.pl, andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, linux-gpio@vger.kernel.org, bgolaszewski@baylibre.com Subject: [PATCH 4/6] irqchip/ixp4xx: Fix return check of __irq_domain_alloc_irqs Date: Sat, 2 Jan 2021 18:58:57 +0100 Message-Id: <20210102175859.335447-4-adam@l4re.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210102175859.335447-1-adam@l4re.org> References: <20210102175859.335447-1-adam@l4re.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 0 is not a proper IRQ number and also indicates failure. Signed-off-by: Adam Lackorzynski --- drivers/irqchip/irq-ixp4xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-ixp4xx.c b/drivers/irqchip/irq-ixp4xx.c index 37e0749215c7..54dcffe2309f 100644 --- a/drivers/irqchip/irq-ixp4xx.c +++ b/drivers/irqchip/irq-ixp4xx.c @@ -355,7 +355,7 @@ void __init ixp4xx_irq_init(resource_size_t irqbase, &fwspec, false, NULL); - if (ret < 0) { + if (ret <= 0) { pr_crit("IXP4XX: can not allocate irqs in hierarchy %d\n", ret); return;