summaryrefslogtreecommitdiff
path: root/scripts/gcc-ld
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2020-03-16 16:43:38 -0500
committerBjorn Helgaas <bhelgaas@google.com>2020-05-12 08:14:29 -0500
commita85a6c86c25be2d2a5f9c31491f612ce0edc7869 (patch)
tree8a03c837d1ef7df86a21b36acfdc1cbf6d9595f1 /scripts/gcc-ld
parent8f3d9f354286745c751374f5f1fcafee6b3f3136 (diff)
driver core: platform: Clarify that IRQ 0 is invalid
These interfaces return a negative error number or an IRQ: platform_get_irq() platform_get_irq_optional() platform_get_irq_byname() platform_get_irq_byname_optional() The function comments suggest checking for error like this: irq = platform_get_irq(...); if (irq < 0) return irq; which is what most callers (~900 of 1400) do, so it's implicit that IRQ 0 is invalid. But some callers check for "irq <= 0", and it's not obvious from the source that we never return an IRQ 0. Make this more explicit by updating the comments to say that an IRQ number is always non-zero and adding a WARN() if we ever do return zero. If we do return IRQ 0, it likely indicates a bug in the arch-specific parts of platform_get_irq(). Relevant prior discussion at [1, 2]. [1] https://lore.kernel.org/r/Pine.LNX.4.64.0701250940220.25027@woody.linux-foundation.org/ [2] https://lore.kernel.org/r/Pine.LNX.4.64.0701252029570.25027@woody.linux-foundation.org/ Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'scripts/gcc-ld')
0 files changed, 0 insertions, 0 deletions