]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
PCI/PME: Restructure pcie_pme_suspend() to prevent compiler warning
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 5 Feb 2016 20:57:19 +0000 (14:57 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 5 Feb 2016 22:28:03 +0000 (16:28 -0600)
commit41ccebaecef50e56f822791a52b7bd9e9608e5e6
treebfab3c754454654b0b88b5c2edcf49f2a1652af6
parent4e48fe4148698ffd3935800f4967362e80a7ae92
PCI/PME: Restructure pcie_pme_suspend() to prevent compiler warning

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: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com
drivers/pci/pcie/pme.c