Re: [PATCH v3 04/26] PCI: endpoint: Use PCI_STD_NUM_BARS

2019-09-18 Thread Denis Efremov
On 9/18/19 12:19 PM, Andrew Murray wrote: > On Mon, Sep 16, 2019 at 11:41:36PM +0300, Denis Efremov wrote: >> To iterate through all possible BARs, loop conditions refactored to the >> *number* of BARs "i < PCI_STD_NUM_BARS", instead of the index of the last >> valid BAR "i <= BAR_5". This is more

Re: [PATCH v3 04/26] PCI: endpoint: Use PCI_STD_NUM_BARS

2019-09-18 Thread Andrew Murray
On Mon, Sep 16, 2019 at 11:41:36PM +0300, Denis Efremov wrote: > To iterate through all possible BARs, loop conditions refactored to the > *number* of BARs "i < PCI_STD_NUM_BARS", instead of the index of the last > valid BAR "i <= BAR_5". This is more idiomatic C style and allows to avoid > the fen

[PATCH v3 04/26] PCI: endpoint: Use PCI_STD_NUM_BARS

2019-09-16 Thread Denis Efremov
To iterate through all possible BARs, loop conditions refactored to the *number* of BARs "i < PCI_STD_NUM_BARS", instead of the index of the last valid BAR "i <= BAR_5". This is more idiomatic C style and allows to avoid the fencepost error. Array definitions changed to PCI_STD_NUM_BARS where appro