diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2022-11-10 20:54:35 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-11 12:28:38 +0300 |
commit | 8836402d4b208b2211fc60538ff45d6bb3b73a64 (patch) | |
tree | 14cc0e7f222ac67a89c32ab2244db6966d2ce123 /drivers/net/ethernet | |
parent | 46ed6026ca2181c917c8334a82e3eaf40a6234dd (diff) | |
download | linux-8836402d4b208b2211fc60538ff45d6bb3b73a64.tar.xz |
usb: Check !irq instead of irq == NO_IRQ
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://lkml.org/lkml/2005/11/21/221 . He re-iterated the same view
recently in https://lkml.org/lkml/2022/10/12/622
So test !irq instead of tesing irq == NO_IRQ.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/13feefdf6b240817944e6441e26a8ddc1d81ced1.1668102802.git.christophe.leroy@csgroup.eu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/ethernet')
0 files changed, 0 insertions, 0 deletions