Re: [PATCH v1] PCI: pciehp: Refactor infinite loop in pcie_poll_cmd()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 07, 2019 at 11:21:12AM -0600, Alex G. wrote:
> 
> Hi Andy,
> On 11/7/19 9:15 AM, Andy Shevchenko wrote:
> > On Fri, Oct 11, 2019 at 12:02:30PM +0300, Andy Shevchenko wrote:
> > > Infinite timeout loops are hard to read.
> 
> Why do you find infinite timeout loops hard to read? I personally find that
> emphasizing the common case to be more redable. An ideal loop for me would
> look like:
> 
> 	do {
> 		do_stuff();

> 		if (timeout) {

Invariant conditional inside loop? okay...

> 			complain();
> 			break()
> 		}
> 	} while (what_we_expect_has_not_happened());

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux