Patch "powerpc: Check !irq instead of irq == NO_IRQ and remove NO_IRQ" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    powerpc: Check !irq instead of irq == NO_IRQ and remove NO_IRQ

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     powerpc-check-irq-instead-of-irq-no_irq-and-remove-n.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b653f9325500ff5e88cf988bcd11dbc766a1ebfb
Author: Christophe Leroy <christophe.leroy@xxxxxxxxxx>
Date:   Mon Jan 23 13:26:46 2023 +0100

    powerpc: Check !irq instead of irq == NO_IRQ and remove NO_IRQ
    
    [ 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@xxxxxxxxxxx
    
    He re-iterated the same view recently in
    https://lore.kernel.org/all/CAHk-=wg2Pkb9kbfbstbB91AJA2SF6cySbsgHG-iQMq56j3VTcA@xxxxxxxxxxxxxx
    
    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 <christophe.leroy@xxxxxxxxxx>
    Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/4b8d4f96140af01dec3a3330924dda8b2451c316.1674476798.git.christophe.leroy@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
index 2b3278534bc14..858393f7fd7d7 100644
--- a/arch/powerpc/include/asm/irq.h
+++ b/arch/powerpc/include/asm/irq.h
@@ -16,9 +16,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);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux