1. 05 Feb, 2016 4 commits
    • Bjorn Helgaas's avatar
      PCI: Move pci_set_flags() from asm-generic/pci-bridge.h to linux/pci.h · 5bbe029f
      Bjorn Helgaas authored
      The PCI flag management constants and functions were previously declared in
      include/asm-generic/pci-bridge.h.  But they are not specific to bridges,
      and arches did not include pci-bridge.h consistently.
      
      Move the following interfaces and related constants to include/linux/pci.h
      and remove pci-bridge.h:
      
        pci_set_flags()
        pci_add_flags()
        pci_clear_flags()
        pci_has_flag()
      
      This fixes these warnings when building for some arches:
      
        drivers/pci/host/pcie-designware.c:562:20: error: 'PCI_PROBE_ONLY' undeclared (first use in this function)
        drivers/pci/host/pcie-designware.c:562:7: error: implicit declaration of function 'pci_has_flag' [-Werror=implicit-function-declaration]
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      5bbe029f
    • Bjorn Helgaas's avatar
      PCI/PME: Restructure pcie_pme_suspend() to prevent compiler warning · 41ccebae
      Bjorn Helgaas authored
      Previously we had this:
      
        if (wakeup)
          ret = enable_irq_wake(...);
        if (!wakeup || ret)
          ...
      
      "ret" is only evaluated when "wakeup" is true, and it is always initialized
      in that case, but gcc isn't smart enough to figure that out and warns:
      
        drivers/pci/pcie/pme.c:414:14: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      Restructure the code slightly to make it easier for gcc (and maybe for
      humans as well).
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com
      41ccebae
    • Bjorn Helgaas's avatar
      PCI/PME: Remove redundant port lookup · 4e48fe41
      Bjorn Helgaas authored
      We've already looked up srv->port a few lines earlier, and there's no need
      to do it again.  Remove the redundant lookup.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com
      4e48fe41
    • Bjorn Helgaas's avatar
      PCI: Check device_attach() return value always · ab1a187b
      Bjorn Helgaas authored
      Previously we checked the device_attach() return value only when
      CONFIG_BUG=y.  That caused this warning in builds where CONFIG_BUG is not
      set:
      
        drivers/pci/bus.c:237:6: warning: variable 'retval' set but not used [-Wunused-but-set-variable]
      
      Check the return value of device_attach() always and clean up after
      failure.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ab1a187b
  2. 24 Jan, 2016 36 commits