From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8CA9C6FA8E for ; Sun, 5 Mar 2023 13:56:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230228AbjCEN4t (ORCPT ); Sun, 5 Mar 2023 08:56:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230073AbjCEN4X (ORCPT ); Sun, 5 Mar 2023 08:56:23 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FEBD1A964; Sun, 5 Mar 2023 05:55:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 80D15B80A07; Sun, 5 Mar 2023 13:54:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98122C433EF; Sun, 5 Mar 2023 13:54:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678024475; bh=pb+Q+GYcGcQPsWmuIlyMyWhdCQgHurrZN8P/5LmXYD8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hGKKddNyJTQ6TXeRWm7TjQmGDIpacUqFxphJ93D2csgmUO0e5ahgvsSk49ld/bSsj G2FY1DYz4RnkXJvDqYv4NqlNMqY0HsieUtBmE0bPT0dxCcq2eYttHmTs1G+icS43Dh 4AO7qM2z6VThpNfdq6akNrJ/7kFaGdKD6Bh1bjY7gSIwmRqMLtY4GkjJyCOdSJK8iV SwSk3Mg3lSh35G7XcQOhvNvv/Nq+YvZMwMZpoU8ViduHC0uRPbsBoBUg+yhIysJTkB 7bvdxH5u8yyN2mZcQ7pOe/Oi51pUpZiwnqI47ym+UWBsY0BbaAjCo1FUYU8FYJesPv rgPaUNsvUm+Wg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christophe Leroy , Michael Ellerman , Sasha Levin , linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 5.10 3/8] powerpc: Check !irq instead of irq == NO_IRQ and remove NO_IRQ Date: Sun, 5 Mar 2023 08:54:20 -0500 Message-Id: <20230305135425.1793964-3-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230305135425.1793964-1-sashal@kernel.org> References: <20230305135425.1793964-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe Leroy [ Upstream commit bab537805a10bdbf55b31324ba4a9599e0651e5e ] NO_IRQ is a relic from the old days. It is not used anymore in core functions. By the way, function irq_of_parse_and_map() returns value 0 on error. In some drivers, NO_IRQ is erroneously used to check the return of irq_of_parse_and_map(). It is not a real bug today because the only architectures using the drivers being fixed by this patch define NO_IRQ as 0, but there are architectures which define NO_IRQ as -1. If one day those architectures start using the non fixed drivers, there will be a problem. Long time ago Linus advocated for not using NO_IRQ, see https://lore.kernel.org/all/Pine.LNX.4.64.0511211150040.13959@g5.osdl.org He re-iterated the same view recently in https://lore.kernel.org/all/CAHk-=wg2Pkb9kbfbstbB91AJA2SF6cySbsgHG-iQMq56j3VTcA@mail.gmail.com So test !irq instead of tesing irq == NO_IRQ. All other usage of NO_IRQ for powerpc were removed in previous cycles so the time has come to remove NO_IRQ completely for powerpc. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/4b8d4f96140af01dec3a3330924dda8b2451c316.1674476798.git.christophe.leroy@csgroup.eu Signed-off-by: Sasha Levin --- arch/powerpc/include/asm/irq.h | 3 --- arch/powerpc/platforms/44x/fsp2.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h index 4f983ca4030a4..4d5e68e6d3b6d 100644 --- a/arch/powerpc/include/asm/irq.h +++ b/arch/powerpc/include/asm/irq.h @@ -17,9 +17,6 @@ extern atomic_t ppc_n_lost_interrupts; -/* This number is used when no interrupt has been assigned */ -#define NO_IRQ (0) - /* Total number of virq in the platform */ #define NR_IRQS CONFIG_NR_IRQS diff --git a/arch/powerpc/platforms/44x/fsp2.c b/arch/powerpc/platforms/44x/fsp2.c index 823397c802def..f8bbe05d9ef29 100644 --- a/arch/powerpc/platforms/44x/fsp2.c +++ b/arch/powerpc/platforms/44x/fsp2.c @@ -205,7 +205,7 @@ static void node_irq_request(const char *compat, irq_handler_t errirq_handler) for_each_compatible_node(np, NULL, compat) { irq = irq_of_parse_and_map(np, 0); - if (irq == NO_IRQ) { + if (!irq) { pr_err("device tree node %pOFn is missing a interrupt", np); of_node_put(np); -- 2.39.2