Signed-off-by: Ken CC <ken.ccao@gmail.com> --- hw/pci.c | 2 +- hw/pci.h | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 70dbace..02019a1 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -47,7 +47,7 @@ struct PCIBus { pci_hotplug_fn hotplug; DeviceState *hotplug_qdev; void *irq_opaque; - PCIDevice *devices[256]; + PCIDevice *devices[PCIBUS_MAX_DEVICES]; PCIDevice *parent_dev; target_phys_addr_t mem_base; diff --git a/hw/pci.h b/hw/pci.h index ccb99d0..f90840c 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -100,6 +100,7 @@ typedef struct PCIIORegion { #define PCI_ROM_SLOT 6 #define PCI_NUM_REGIONS 7 +#define PCIBUS_MAX_DEVICES 256 #include "pci_regs.h"
Signed-off-by: Ken CC <ken.ccao@gmail.com> --- hw/pci.c | 2 +- hw/pci.h | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 70dbace..02019a1 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -47,7 +47,7 @@ struct PCIBus { pci_hotplug_fn hotplug; DeviceState *hotplug_qdev; void *irq_opaque; - PCIDevice *devices[256]; + PCIDevice *devices[PCIBUS_MAX_DEVICES]; PCIDevice *parent_dev; target_phys_addr_t mem_base; diff --git a/hw/pci.h b/hw/pci.h index ccb99d0..f90840c 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -100,6 +100,7 @@ typedef struct PCIIORegion { #define PCI_ROM_SLOT 6 #define PCI_NUM_REGIONS 7 +#define PCIBUS_MAX_DEVICES 256 #include "pci_regs.h"
Define MAX_PCI_SLOTS as 0x1f, if pci addr provided from command line is bigger than 0x1f, return error -EINVAL. 0x1f << 3 | 7 == 255 (PCIBUS_MAX_DEVICES - 1) Signed-off-by: Ken CC <ken.ccao@gmail.com> --- hw/qdev-properties.c | 2 ++ hw/qdev.h | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index 9219cd7..96d814c 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -514,6 +514,8 @@ static int parse_pci_devfn(DeviceState *dev, Property *prop, const char *str) return -EINVAL; } } + if (slot > MAX_PCI_SLOTS) + return -EINVAL; if (str[n] != '\0') return -EINVAL; if (fn > 7) diff --git a/hw/qdev.h b/hw/qdev.h index 678f8b7..fcfe52e 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -7,6 +7,9 @@ #include "qemu-char.h" #include "qemu-option.h" + +#define MAX_PCI_SLOTS 0x1f + typedef struct Property Property; typedef struct PropertyInfo PropertyInfo;
assert(devfn < PCIBUS_MAX_DEVICES) Signed-off-by: Ken CC <ken.ccao@gmail.com> --- hw/pci.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 02019a1..1e804da 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -747,6 +747,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, PCIConfigWriteFunc *config_write, bool is_bridge) { + assert(devfn < PCIBUS_MAX_DEVICES); if (devfn < 0) { for(devfn = bus->devfn_min ; devfn < ARRAY_SIZE(bus->devices); devfn += PCI_FUNC_MAX) {
assert(devfn < PCIBUS_MAX_DEVICES) Signed-off-by: Ken CC <ken.ccao@gmail.com> --- hw/pci.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 02019a1..1e804da 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -747,6 +747,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, PCIConfigWriteFunc *config_write, bool is_bridge) { + assert(devfn < PCIBUS_MAX_DEVICES); if (devfn < 0) { for(devfn = bus->devfn_min ; devfn < ARRAY_SIZE(bus->devices); devfn += PCI_FUNC_MAX) {
Define MAX_PCI_SLOTS as 0x1f, if pci addr provided from command line is bigger than 0x1f, return error -EINVAL. 0x1f << 3 | 7 == 255 (PCIBUS_MAX_DEVICES - 1) Signed-off-by: Ken CC <ken.ccao@gmail.com> --- hw/qdev-properties.c | 2 ++ hw/qdev.h | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index 9219cd7..96d814c 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -514,6 +514,8 @@ static int parse_pci_devfn(DeviceState *dev, Property *prop, const char *str) return -EINVAL; } } + if (slot > MAX_PCI_SLOTS) + return -EINVAL; if (str[n] != '\0') return -EINVAL; if (fn > 7) diff --git a/hw/qdev.h b/hw/qdev.h index 678f8b7..fcfe52e 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -7,6 +7,9 @@ #include "qemu-char.h" #include "qemu-option.h" + +#define MAX_PCI_SLOTS 0x1f + typedef struct Property Property; typedef struct PropertyInfo PropertyInfo;
Define MAX_PCI_SLOTS as 0x1f, if pci addr provided from command line is bigger than 0x1f, return error -EINVAL. 0x1f << 3 | 7 == 255 (PCIBUS_MAX_DEVICES - 1) Signed-off-by: Ken CC <ken.ccao@gmail.com> --- hw/qdev-properties.c | 2 ++ hw/qdev.h | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index 9219cd7..96d814c 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -514,6 +514,8 @@ static int parse_pci_devfn(DeviceState *dev, Property *prop, const char *str) return -EINVAL; } } + if (slot > MAX_PCI_SLOTS) + return -EINVAL; if (str[n] != '\0') return -EINVAL; if (fn > 7) diff --git a/hw/qdev.h b/hw/qdev.h index 678f8b7..fcfe52e 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -7,6 +7,9 @@ #include "qemu-char.h" #include "qemu-option.h" + +#define MAX_PCI_SLOTS 0x1f + typedef struct Property Property; typedef struct PropertyInfo PropertyInfo;
Add Cc: mst@redhat.com.
MAX_PCI_SLOTS should be in pci.h instead of qdev.h?
And the name should be start with PCI_ prefix for consistency?
Except that, the patches look okay.
thanks,
On Tue, Aug 24, 2010 at 02:49:27PM +0800, Ken CC wrote:
> Define MAX_PCI_SLOTS as 0x1f, if pci addr provided from command line
> is bigger than 0x1f, return error -EINVAL.
>
> 0x1f << 3 | 7 == 255 (PCIBUS_MAX_DEVICES - 1)
>
> Signed-off-by: Ken CC <ken.ccao@gmail.com>
> ---
> hw/qdev-properties.c | 2 ++
> hw/qdev.h | 3 +++
> 2 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
> index 9219cd7..96d814c 100644
> --- a/hw/qdev-properties.c
> +++ b/hw/qdev-properties.c
> @@ -514,6 +514,8 @@ static int parse_pci_devfn(DeviceState *dev, Property *prop, const char *str)
> return -EINVAL;
> }
> }
> + if (slot > MAX_PCI_SLOTS)
> + return -EINVAL;
> if (str[n] != '\0')
> return -EINVAL;
> if (fn > 7)
> diff --git a/hw/qdev.h b/hw/qdev.h
> index 678f8b7..fcfe52e 100644
> --- a/hw/qdev.h
> +++ b/hw/qdev.h
> @@ -7,6 +7,9 @@
> #include "qemu-char.h"
> #include "qemu-option.h"
>
> +
> +#define MAX_PCI_SLOTS 0x1f
> +
> typedef struct Property Property;
>
> typedef struct PropertyInfo PropertyInfo;
>
>
--
yamahata
Add Cc: mst@redhat.com.
MAX_PCI_SLOTS should be in pci.h instead of qdev.h?
And the name should be start with PCI_ prefix for consistency?
Except that, the patches look okay.
thanks,
On Tue, Aug 24, 2010 at 02:49:27PM +0800, Ken CC wrote:
> Define MAX_PCI_SLOTS as 0x1f, if pci addr provided from command line
> is bigger than 0x1f, return error -EINVAL.
>
> 0x1f << 3 | 7 == 255 (PCIBUS_MAX_DEVICES - 1)
>
> Signed-off-by: Ken CC <ken.ccao@gmail.com>
> ---
> hw/qdev-properties.c | 2 ++
> hw/qdev.h | 3 +++
> 2 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
> index 9219cd7..96d814c 100644
> --- a/hw/qdev-properties.c
> +++ b/hw/qdev-properties.c
> @@ -514,6 +514,8 @@ static int parse_pci_devfn(DeviceState *dev, Property *prop, const char *str)
> return -EINVAL;
> }
> }
> + if (slot > MAX_PCI_SLOTS)
> + return -EINVAL;
> if (str[n] != '\0')
> return -EINVAL;
> if (fn > 7)
> diff --git a/hw/qdev.h b/hw/qdev.h
> index 678f8b7..fcfe52e 100644
> --- a/hw/qdev.h
> +++ b/hw/qdev.h
> @@ -7,6 +7,9 @@
> #include "qemu-char.h"
> #include "qemu-option.h"
>
> +
> +#define MAX_PCI_SLOTS 0x1f
> +
> typedef struct Property Property;
>
> typedef struct PropertyInfo PropertyInfo;
>
>
--
yamahata
On 08/24/2010 02:35 PM, Isaku Yamahata wrote:
> Add Cc: mst@redhat.com.
>
> MAX_PCI_SLOTS should be in pci.h instead of qdev.h?
> And the name should be start with PCI_ prefix for consistency?
>
> Except that, the patches look okay.
>
These aren't slots, are they? They are functions.
There's a lot of slot/function confusion in qemu.
--
error compiling committee.c: too many arguments to function
On 08/24/2010 02:35 PM, Isaku Yamahata wrote:
> Add Cc: mst@redhat.com.
>
> MAX_PCI_SLOTS should be in pci.h instead of qdev.h?
> And the name should be start with PCI_ prefix for consistency?
>
> Except that, the patches look okay.
>
These aren't slots, are they? They are functions.
There's a lot of slot/function confusion in qemu.
--
error compiling committee.c: too many arguments to function
On 08/24/2010 03:07 PM, Isaku Yamahata wrote:
> On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote:
>> On 08/24/2010 02:35 PM, Isaku Yamahata wrote:
>>> Add Cc: mst@redhat.com.
>>>
>>> MAX_PCI_SLOTS should be in pci.h instead of qdev.h?
>>> And the name should be start with PCI_ prefix for consistency?
>>>
>>> Except that, the patches look okay.
>>>
>> These aren't slots, are they? They are functions.
> The function checks if given $slot.$fn (or $slot) is valid.
> So it's slots. max 32.
+ assert(devfn< PCIBUS_MAX_DEVICES);
Looks like we're comparing a function number to PCIBUS_MAX_DEVICES.
--
error compiling committee.c: too many arguments to function
On 08/24/2010 03:07 PM, Isaku Yamahata wrote:
> On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote:
>> On 08/24/2010 02:35 PM, Isaku Yamahata wrote:
>>> Add Cc: mst@redhat.com.
>>>
>>> MAX_PCI_SLOTS should be in pci.h instead of qdev.h?
>>> And the name should be start with PCI_ prefix for consistency?
>>>
>>> Except that, the patches look okay.
>>>
>> These aren't slots, are they? They are functions.
> The function checks if given $slot.$fn (or $slot) is valid.
> So it's slots. max 32.
+ assert(devfn< PCIBUS_MAX_DEVICES);
Looks like we're comparing a function number to PCIBUS_MAX_DEVICES.
--
error compiling committee.c: too many arguments to function
On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: > On 08/24/2010 02:35 PM, Isaku Yamahata wrote: >> Add Cc: mst@redhat.com. >> >> MAX_PCI_SLOTS should be in pci.h instead of qdev.h? >> And the name should be start with PCI_ prefix for consistency? >> >> Except that, the patches look okay. >> > > These aren't slots, are they? They are functions. The function checks if given $slot.$fn (or $slot) is valid. So it's slots. max 32. > There's a lot of slot/function confusion in qemu. Agreed. -- yamahata
On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: > On 08/24/2010 02:35 PM, Isaku Yamahata wrote: >> Add Cc: mst@redhat.com. >> >> MAX_PCI_SLOTS should be in pci.h instead of qdev.h? >> And the name should be start with PCI_ prefix for consistency? >> >> Except that, the patches look okay. >> > > These aren't slots, are they? They are functions. The function checks if given $slot.$fn (or $slot) is valid. So it's slots. max 32. > There's a lot of slot/function confusion in qemu. Agreed. -- yamahata
On 08/24/2010 03:24 PM, Isaku Yamahata wrote:
> On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote:
>> On 08/24/2010 03:07 PM, Isaku Yamahata wrote:
>>> On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote:
>>>> On 08/24/2010 02:35 PM, Isaku Yamahata wrote:
>>>>> Add Cc: mst@redhat.com.
>>>>>
>>>>> MAX_PCI_SLOTS should be in pci.h instead of qdev.h?
>>>>> And the name should be start with PCI_ prefix for consistency?
>>>>>
>>>>> Except that, the patches look okay.
>>>>>
>>>> These aren't slots, are they? They are functions.
>>> The function checks if given $slot.$fn (or $slot) is valid.
>>> So it's slots. max 32.
>> + assert(devfn< PCIBUS_MAX_DEVICES);
>>
>>
>> Looks like we're comparing a function number to PCIBUS_MAX_DEVICES.
> Ah, you're talking about 2/3. I talked about 3/3.
> You're right. The name is misleading.
> PCIBUS_MAX_FUNCTIONS? Or suggestions?
Or assert(devfn / 8 < PCIBUS_MAX_DEVICES) (and change that to be 32).
--
error compiling committee.c: too many arguments to function
On 08/24/2010 03:24 PM, Isaku Yamahata wrote:
> On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote:
>> On 08/24/2010 03:07 PM, Isaku Yamahata wrote:
>>> On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote:
>>>> On 08/24/2010 02:35 PM, Isaku Yamahata wrote:
>>>>> Add Cc: mst@redhat.com.
>>>>>
>>>>> MAX_PCI_SLOTS should be in pci.h instead of qdev.h?
>>>>> And the name should be start with PCI_ prefix for consistency?
>>>>>
>>>>> Except that, the patches look okay.
>>>>>
>>>> These aren't slots, are they? They are functions.
>>> The function checks if given $slot.$fn (or $slot) is valid.
>>> So it's slots. max 32.
>> + assert(devfn< PCIBUS_MAX_DEVICES);
>>
>>
>> Looks like we're comparing a function number to PCIBUS_MAX_DEVICES.
> Ah, you're talking about 2/3. I talked about 3/3.
> You're right. The name is misleading.
> PCIBUS_MAX_FUNCTIONS? Or suggestions?
Or assert(devfn / 8 < PCIBUS_MAX_DEVICES) (and change that to be 32).
--
error compiling committee.c: too many arguments to function
On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote: > On 08/24/2010 03:07 PM, Isaku Yamahata wrote: > >On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: > >> On 08/24/2010 02:35 PM, Isaku Yamahata wrote: > >>>Add Cc: mst@redhat.com. > >>> > >>>MAX_PCI_SLOTS should be in pci.h instead of qdev.h? > >>>And the name should be start with PCI_ prefix for consistency? > >>> > >>>Except that, the patches look okay. > >>> > >>These aren't slots, are they? They are functions. > >The function checks if given $slot.$fn (or $slot) is valid. > >So it's slots. max 32. > > + assert(devfn< PCIBUS_MAX_DEVICES); > > > Looks like we're comparing a function number to PCIBUS_MAX_DEVICES. > PCIBUS_MAX_DEVICES is the size of PCIBus.devices[], I have added it in the first patch at the defination of struct PCIBus, line 50 hw/pci.c. so i think the better name of the macro should be PCIBUS_MAX_FN, right? Ken > -- > error compiling committee.c: too many arguments to function > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --
On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote: > On 08/24/2010 03:07 PM, Isaku Yamahata wrote: > >On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: > >> On 08/24/2010 02:35 PM, Isaku Yamahata wrote: > >>>Add Cc: mst@redhat.com. > >>> > >>>MAX_PCI_SLOTS should be in pci.h instead of qdev.h? > >>>And the name should be start with PCI_ prefix for consistency? > >>> > >>>Except that, the patches look okay. > >>> > >>These aren't slots, are they? They are functions. > >The function checks if given $slot.$fn (or $slot) is valid. > >So it's slots. max 32. > > + assert(devfn< PCIBUS_MAX_DEVICES); > > > Looks like we're comparing a function number to PCIBUS_MAX_DEVICES. > PCIBUS_MAX_DEVICES is the size of PCIBus.devices[], I have added it in the first patch at the defination of struct PCIBus, line 50 hw/pci.c. so i think the better name of the macro should be PCIBUS_MAX_FN, right? Ken > -- > error compiling committee.c: too many arguments to function > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --
On 08/24/2010 03:16 PM, Chen Cao wrote:
> On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote:
>> On 08/24/2010 03:07 PM, Isaku Yamahata wrote:
>>> On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote:
>>>> On 08/24/2010 02:35 PM, Isaku Yamahata wrote:
>>>>> Add Cc: mst@redhat.com.
>>>>>
>>>>> MAX_PCI_SLOTS should be in pci.h instead of qdev.h?
>>>>> And the name should be start with PCI_ prefix for consistency?
>>>>>
>>>>> Except that, the patches look okay.
>>>>>
>>>> These aren't slots, are they? They are functions.
>>> The function checks if given $slot.$fn (or $slot) is valid.
>>> So it's slots. max 32.
>> + assert(devfn< PCIBUS_MAX_DEVICES);
>>
>>
>> Looks like we're comparing a function number to PCIBUS_MAX_DEVICES.
>>
> PCIBUS_MAX_DEVICES is the size of PCIBus.devices[], I have added it in
> the first patch at the defination of struct PCIBus, line 50 hw/pci.c.
> so i think the better name of the macro should be PCIBUS_MAX_FN,
> right?
Or make it 32 and scale it by PCI_FUNCTIONS_PER_DEVICE.
PCIBus.devices[] should be renamed to functions[] (later).
--
error compiling committee.c: too many arguments to function
On 08/24/2010 03:16 PM, Chen Cao wrote:
> On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote:
>> On 08/24/2010 03:07 PM, Isaku Yamahata wrote:
>>> On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote:
>>>> On 08/24/2010 02:35 PM, Isaku Yamahata wrote:
>>>>> Add Cc: mst@redhat.com.
>>>>>
>>>>> MAX_PCI_SLOTS should be in pci.h instead of qdev.h?
>>>>> And the name should be start with PCI_ prefix for consistency?
>>>>>
>>>>> Except that, the patches look okay.
>>>>>
>>>> These aren't slots, are they? They are functions.
>>> The function checks if given $slot.$fn (or $slot) is valid.
>>> So it's slots. max 32.
>> + assert(devfn< PCIBUS_MAX_DEVICES);
>>
>>
>> Looks like we're comparing a function number to PCIBUS_MAX_DEVICES.
>>
> PCIBUS_MAX_DEVICES is the size of PCIBus.devices[], I have added it in
> the first patch at the defination of struct PCIBus, line 50 hw/pci.c.
> so i think the better name of the macro should be PCIBUS_MAX_FN,
> right?
Or make it 32 and scale it by PCI_FUNCTIONS_PER_DEVICE.
PCIBus.devices[] should be renamed to functions[] (later).
--
error compiling committee.c: too many arguments to function
On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote:
> On 08/24/2010 03:07 PM, Isaku Yamahata wrote:
>> On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote:
>>> On 08/24/2010 02:35 PM, Isaku Yamahata wrote:
>>>> Add Cc: mst@redhat.com.
>>>>
>>>> MAX_PCI_SLOTS should be in pci.h instead of qdev.h?
>>>> And the name should be start with PCI_ prefix for consistency?
>>>>
>>>> Except that, the patches look okay.
>>>>
>>> These aren't slots, are they? They are functions.
>> The function checks if given $slot.$fn (or $slot) is valid.
>> So it's slots. max 32.
>
> + assert(devfn< PCIBUS_MAX_DEVICES);
>
>
> Looks like we're comparing a function number to PCIBUS_MAX_DEVICES.
Ah, you're talking about 2/3. I talked about 3/3.
You're right. The name is misleading.
PCIBUS_MAX_FUNCTIONS? Or suggestions?
--
yamahata
On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote:
> On 08/24/2010 03:07 PM, Isaku Yamahata wrote:
>> On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote:
>>> On 08/24/2010 02:35 PM, Isaku Yamahata wrote:
>>>> Add Cc: mst@redhat.com.
>>>>
>>>> MAX_PCI_SLOTS should be in pci.h instead of qdev.h?
>>>> And the name should be start with PCI_ prefix for consistency?
>>>>
>>>> Except that, the patches look okay.
>>>>
>>> These aren't slots, are they? They are functions.
>> The function checks if given $slot.$fn (or $slot) is valid.
>> So it's slots. max 32.
>
> + assert(devfn< PCIBUS_MAX_DEVICES);
>
>
> Looks like we're comparing a function number to PCIBUS_MAX_DEVICES.
Ah, you're talking about 2/3. I talked about 3/3.
You're right. The name is misleading.
PCIBUS_MAX_FUNCTIONS? Or suggestions?
--
yamahata