[PATCH v6 06/30] PCI: Combine PCI domain and bus number in u32 arg
Yijing Wang
wangyijing at huawei.com
Thu Mar 12 20:19:12 PDT 2015
>> struct pci_scan_info {
>> int bus;
>> struct device *parent;
>> struct pci_ops *ops;
>> void *sysdata;
>> struct list_head *resource;
>> int domain;
>> struct pci_host_bridge_ops;
>> }
>>
>> Do you like this one or keep it like now ?
>>
>> pci_scan_root_bus(struct device *parent, int domain, int bus,
>> struct pci_ops *ops, void *sysdata, struct list_head *resources, struct pci_host_bridge_ops *ops)
>
> I don't think reducing the number of arguments is a good argument for
> squashing some of them together.
>
> I don't really want to add a structure like that because it adds management
> complexity for all the callers because it contains per-bridge things (bus,
> parent, domain, resource, sysdata). Things like struct pci_ops and struct
> pci_host_bridge_ops are much simpler because drivers can statically
> allocate a single copy and use it for multiple devices.
>
> I think it might make sense to put the struct pci_ops pointer inside struct
> pci_host_bridge_ops. That would get rid of one of the arguments.
>
> You might also be able to get rid of the "bus" argument, since the caller
> should be passing an IORESOURCE_BUS resource in the resource list, and
> "bus" should be the same as res->start.
I think this make sense, I will try to find a better solution.
Thanks!
Yijing.
>
> Bjorn
>
> .
>
--
Thanks!
Yijing
More information about the linux-arm-kernel
mailing list