Re: [PATCH v6 06/30] PCI: Combine PCI domain and bus number in u32 arg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux