• 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
pme.c 11.8 KB