]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: pciehp: Refactor infinite loop in pcie_poll_cmd()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 8 Nov 2019 11:18:55 +0000 (13:18 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 12 Nov 2019 00:15:36 +0000 (18:15 -0600)
commit832f7c8b5ab2beae8d9450bb320967100659af2d
treee61728baa7e31add2cba66d9b455a631fa745221
parent1fc0693f796caaf7caab8aabac737a49063c0f95
PCI: pciehp: Refactor infinite loop in pcie_poll_cmd()

Infinite timeout loops are hard to read. Refactor it to plausible 'do {}
while ()'.

Note, the supplied timeout can't be negative for current use, though if
it's not dividable to 10, we may go below 0, that's why type of the
parameter is int. And thus, we may move the check to the loop condition.

No functional change intended.

Link: https://lore.kernel.org/r/20191108111855.85866-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andrew Murray <andrew.murray@arm.com>
drivers/pci/hotplug/pciehp_hpc.c