Re: [PATCH 0/7] Add definition for the number of standard PCI BARs

2019-08-12 Thread Denis Efremov
On 12.08.2019 12:06, Andrew Murray wrote: > > Hi Denis, Hi! > > You could also fix up a few cases where the number of BARs is hard coded in > loops, e.g. > > drivers/pci/controller/pci-hyperv.c - look for uses of probed_bar in loops > drivers/pci/pci.c - pci_release_selected_regions and >

Re: [PATCH 0/7] Add definition for the number of standard PCI BARs

2019-08-12 Thread Thomas Gleixner
On Mon, 12 Aug 2019, Bjorn Helgaas wrote: > On Sun, Aug 11, 2019 at 06:07:55PM +0300, Denis Efremov wrote: > > Code that iterates over all standard PCI BARs typically uses > > PCI_STD_RESOURCE_END, but this is error-prone because it requires > > "i <= PCI_STD_RESOURCE_END" rather than something

Re: [PATCH 0/7] Add definition for the number of standard PCI BARs

2019-08-12 Thread Bjorn Helgaas
On Sun, Aug 11, 2019 at 06:07:55PM +0300, Denis Efremov wrote: > Code that iterates over all standard PCI BARs typically uses > PCI_STD_RESOURCE_END, but this is error-prone because it requires > "i <= PCI_STD_RESOURCE_END" rather than something like > "i < PCI_STD_NUM_BARS". We could add such a

Re: [PATCH 0/7] Add definition for the number of standard PCI BARs

2019-08-12 Thread Andrew Murray
On Sun, Aug 11, 2019 at 06:07:55PM +0300, Denis Efremov wrote: > Code that iterates over all standard PCI BARs typically uses > PCI_STD_RESOURCE_END, but this is error-prone because it requires > "i <= PCI_STD_RESOURCE_END" rather than something like > "i < PCI_STD_NUM_BARS". We could add such a

[PATCH 0/7] Add definition for the number of standard PCI BARs

2019-08-11 Thread Denis Efremov
Code that iterates over all standard PCI BARs typically uses PCI_STD_RESOURCE_END, but this is error-prone because it requires "i <= PCI_STD_RESOURCE_END" rather than something like "i < PCI_STD_NUM_BARS". We could add such a definition and use it the same way PCI_SRIOV_NUM_BARS is used. There is