On Wed, Aug 22, 2012 at 10:31 AM, Yinghai Lu <yinghai@xxxxxxxxxx> wrote: > On Wed, Aug 22, 2012 at 3:15 AM, Ram Pai <linuxram@xxxxxxxxxx> wrote: >> On Tue, Aug 21, 2012 at 04:22:52PM -0700, Yinghai Lu wrote: >>> On Tue, Aug 21, 2012 at 8:13 AM, Ram Pai <linuxram@xxxxxxxxxx> wrote: >> by exposing idx through the interface, we are exposing the implementation to >> the enduser. I want the end user not know that the resources are >> structured as a array. This will help easily restructure resources >> in the pci_dev structure to whatever implementation we want, linked list >> or hash or whatever... >> >> Why can't the addon resource be hidden behind the interface? something >> like this? > keep the idx would make thing simple for referencing and converting. pci_dev_resource_n() would be wrapper to from idx to real resource pointer. we just need to change &dev->resource[i] referencing to pci_dev_resource_n(dev, i) instead. We did that before for irq_desc storage converting, and now we have for_each_irq_desc(irq, desc) later for the resource allocation, I will change resource member from struct resource resource[DEVICE_COUNT_RESOURCE]; to struct resource std_res[7]; struct resource *iov_res; struct resource *bridge_res; and allocate iov_res and bridge array as needed. anyway keep the overalll idx is good way to go and follow. Thanks Yinghai -- 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