lkml.org 
[lkml]   [2010]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 09/11] pci: pci_bridge_release_res
> +void pci_bridge_release_res(struct pci_bus *bus)
> +{
> + int idx;
> + bool changed = false;
> + struct pci_dev *dev;
> + struct resource *r;
> +
> + /* The root bus? */
> + if (!bus->self)
> + return;
> +
> + /* for pci bridges res only */
> + dev = bus->self;
> + if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI)
> + return;
> +
> + for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_BRIDGE_RESOURCES + 3;
> + idx++) {
> + r = &dev->resource[idx];
> + if (!r->parent)
> + continue;
> +
> + /* if there are children under that, we should not release it */
> + if (r->child)
> + continue;
> +
> + if (!release_resource(r)) {
> + dev_printk(KERN_DEBUG, &dev->dev,
> + "resource %d %pR released\n", idx, r);
> + /* old size is not kept */
> + r->start = 0;
> + r->end = 0;
> + r->flags = 0;
> + changed = true;
> + }
> + }
> +
> + if (changed)
> + pci_setup_bridge(bus);
> +}
> +EXPORT_SYMBOL_GPL(pci_bridge_release_res);
> +
> static void pci_bridge_release_resources(struct pci_bus *bus,
> unsigned long type)

My brain is melting.

Why do we have pci_bridge_release_res and pci_bridge_release_resources?

The code is similar, but not the same. The names are similar but
not the same.

Any chance you could factor similarities, and then write a
comment that explains the differences to a developer?

thanks,
/ac



\
 
 \ /
  Last update: 2010-01-16 06:01    [W:0.099 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site