linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] PCI: Check for platform_get_irq() failure consistently
@ 2020-05-01 22:40 Bjorn Helgaas
  2020-05-01 22:40 ` [PATCH v2 1/2] driver core: platform: Clarify that IRQ 0 is invalid Bjorn Helgaas
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Bjorn Helgaas @ 2020-05-01 22:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Thomas Gleixner
  Cc: Rafael J . Wysocki, Aman Sharma, linux-pci, linux-kernel, Bjorn Helgaas

From: Bjorn Helgaas <bhelgaas@google.com>

All callers of platform_get_irq() and related functions interpret a
negative return value as an error.  A few also interpret zero as an error.

platform_get_irq() should return either a negative error number or a valid
non-zero IRQ, so there's no need to check for zero.

This series:

  - Extends the platform_get_irq() function comment to say it returns a
    non-zero IRQ number or a negative error number.

  - Adds a WARN() if platform_get_irq() ever *does* return zero (this would
    be a bug in the underlying arch code, and most callers are not prepared
    for this).

  - Updates drivers/pci/ to check consistently using "irq < 0".

This is based on Aman's series [1].  I propose to merge this via the PCI
tree, given acks from Greg and Thomas.

[1] https://lore.kernel.org/r/cover.1583952275.git.amanharitsh123@gmail.com

Aman Sharma (1):
  PCI: Check for platform_get_irq() failure consistently

Bjorn Helgaas (1):
  driver core: platform: Clarify that IRQ 0 is invalid

 drivers/base/platform.c                       | 40 ++++++++++++-------
 drivers/pci/controller/dwc/pci-imx6.c         |  4 +-
 drivers/pci/controller/dwc/pcie-tegra194.c    |  4 +-
 .../controller/mobiveil/pcie-mobiveil-host.c  |  4 +-
 drivers/pci/controller/pci-aardvark.c         |  3 ++
 drivers/pci/controller/pci-v3-semi.c          |  4 +-
 drivers/pci/controller/pcie-mediatek.c        |  3 ++
 drivers/pci/controller/pcie-tango.c           |  4 +-
 8 files changed, 41 insertions(+), 25 deletions(-)


base-commit: 8f3d9f354286745c751374f5f1fcafee6b3f3136
-- 
2.25.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-05-13 17:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-01 22:40 [PATCH v2 0/2] PCI: Check for platform_get_irq() failure consistently Bjorn Helgaas
2020-05-01 22:40 ` [PATCH v2 1/2] driver core: platform: Clarify that IRQ 0 is invalid Bjorn Helgaas
2020-05-02  6:15   ` Greg Kroah-Hartman
2020-05-04 18:08     ` Bjorn Helgaas
2020-05-04 19:07       ` Greg Kroah-Hartman
2020-05-04 22:26         ` Bjorn Helgaas
2020-05-05 13:35           ` Greg Kroah-Hartman
2020-05-01 22:40 ` [PATCH v2 2/2] PCI: Check for platform_get_irq() failure consistently Bjorn Helgaas
2020-05-12 12:35 ` [PATCH v2 0/2] " Linus Walleij
2020-05-13 17:44 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).