Re: [PATCH v3 17/26] vfio_pci: Loop using PCI_STD_NUM_BARS

2019-09-19 Thread Andrew Murray
On Wed, Sep 18, 2019 at 05:31:33PM +0300, Denis Efremov wrote: > On 9/18/19 12:17 PM, Andrew Murray wrote: > > On Mon, Sep 16, 2019 at 11:41:49PM +0300, Denis Efremov wrote: > >> Refactor loops to use idiomatic C style and avoid the fencepost error > >> of using "i < PCI_STD_RESOURCE_END" when "i <

Re: [PATCH v3 17/26] vfio_pci: Loop using PCI_STD_NUM_BARS

2019-09-18 Thread Denis Efremov
On 9/18/19 12:17 PM, Andrew Murray wrote: > On Mon, Sep 16, 2019 at 11:41:49PM +0300, Denis Efremov wrote: >> Refactor loops to use idiomatic C style and avoid the fencepost error >> of using "i < PCI_STD_RESOURCE_END" when "i <= PCI_STD_RESOURCE_END" >> is required, e.g., commit 2f686f1d9bee ("PCI

Re: [PATCH v3 17/26] vfio_pci: Loop using PCI_STD_NUM_BARS

2019-09-18 Thread Andrew Murray
On Mon, Sep 16, 2019 at 11:41:49PM +0300, Denis Efremov wrote: > Refactor loops to use idiomatic C style and avoid the fencepost error > of using "i < PCI_STD_RESOURCE_END" when "i <= PCI_STD_RESOURCE_END" > is required, e.g., commit 2f686f1d9bee ("PCI: Correct PCI_STD_RESOURCE_END > usage"). > >

[PATCH v3 17/26] vfio_pci: Loop using PCI_STD_NUM_BARS

2019-09-16 Thread Denis Efremov
Refactor loops to use idiomatic C style and avoid the fencepost error of using "i < PCI_STD_RESOURCE_END" when "i <= PCI_STD_RESOURCE_END" is required, e.g., commit 2f686f1d9bee ("PCI: Correct PCI_STD_RESOURCE_END usage"). To iterate through all possible BARs, loop conditions changed to the *numbe