diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2022-11-11 09:30:46 +0100 |
---|---|---|
committer | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2022-11-12 11:00:04 +0900 |
commit | 01a965d750508cacdfc8aa04e567cbb0692ce649 (patch) | |
tree | df0411b02a354b89063b9941b3310bfef84839a6 /tools/perf/scripts/python/check-perf-trace.py | |
parent | aebf1e26a84f2e38cf38aa228546adc2a2ede1fb (diff) |
ata: sata_dwc_460ex: 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.
And remove the fallback definition of NO_IRQ at the top of the file.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Diffstat (limited to 'tools/perf/scripts/python/check-perf-trace.py')
0 files changed, 0 insertions, 0 deletions